If , under the legislation of a Member State , the granting of benefits in respect of an occupational disease is subject to the condition that an activity likely to cause the disease in question was pursued for a certain length of time , the competent institution of the State shall take into account , to the extent necessary , periods during which such activity was pursued under the legislation of any other Member State , as if it had been pursued under the legislation of the first State .