#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 47
#endif
#define int long long
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> a(n), b(n);
for (int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
if (a == b) {
cout << "Yes\n";
return 0;
}
bool loop = true;
while (loop) {
loop = false;
for (int i = 0; i < n; i++) {
int j = (i + 1) % n;
if (a[i] > b[i]) {
int x = (a[i] - b[i] + 1) / 2;
a[j] += x;
a[i] -= x * 2;
loop = true;
}
}
}
cout << (a == b ? "Yes" : "No") << '\n';
return 0;
}