Intervals
시간 제한1초메모리 제한512 MB
길이가 같은 n개 구간의 모든 쌍별 교집합 길이가 주어질 때, 그런 구간이 실제로 존재할 수 있는지 판정한다.
문제
Bobo draws intervals on the axis, which are conveniently numbered by . As an excellent mathematician, he managed to set all intervals of length .
Then bobo carefully computes , the length of the intersection of intervals and , and discards all intervals. However, bobo wants to check his calculations and he is eager to know whether the result can be correct.
In another word, determine if there exists intervals of length providing the same result.
입력
The first line contains an integer ().
Each of the following lines contains integers ().
Since bobo knows math well, it is guaranteed that and .
출력
If for given it is possible to find at least one appropriate set of intervals, print "Yes". Otherwise, print "No".