Magnetocrystalline anisotropy of YCo5and Y2Co17