Round-table conferences were held around the round table, ensuring equal participations for leaders and attendants. It’s a custom holding the belief that “All men are created equal”, derived from the British story of King Arthur and his round table knights.
One day, Zero, as a sponsor holding a round-table conference, faces a tough problem. He knows that there are n groups of people (groups are labeled from 0 to n - 1) and m seats around the table (seats are labeled from 0 to m - 1) in the conference. There are ai people in the i-th group. They should be assigned seats within range (li, (li + 1)%m, (li+ 2)%m, . . . , ri).In a valid arrangment, everyone has a single seat, and no seat can be shared by more than one person. Zero wants to know whether such an arrangement exists.