A generalization of Morley’s congruence