Black hole accretion preferentially occurs in gas-rich galaxies*