Williams and Yamal help Spain overcome challenges