Effect of hydrogen absorption on magnetic properties of GdCo5 and YCo5