/* Problem idea by Albert Lai Problem written by Albert Lai This solution written by Thomas Tang */ #include #include int main() { int w; int diff; int firsttime = 1; scanf("%d", &w); while (w--) { int thisDiff, a, b; scanf("%d%d", &a, &b); thisDiff = abs(a-b); if (firsttime) { diff = thisDiff; firsttime = 0; } else { if (diff != thisDiff) { printf("no\n"); return 0; } } } printf("yes\n"); }