// Starcraft 2 enjoyer //
#include <bits/stdc++.h>
// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
using namespace std;
#define LSOne(X) ((X) & -(X))
const int N = 2e6 + 5;
const int M = 1e6 + 5;
const int B = 18;
const long long K = 2;
const int LG = 20;
const int INF = 1e9 + 5;
const int P = 31;
const int MOD = 1e9 + 7;
const int nx[] = {0, 1, 0, -1}, ny[] = {-1, 0, 1, 0};
long long n, a[N], b[N];
inline void solve()
{
cin >> n;
for (int x = 0; x < n; x++)
{
cin >> a[x] >> b[x];
}
for (int y = 0; y < 32; y++)
{
for (int x = 0; x < n; x++)
{
if (a[x] > b[x])
{
if ((a[x] - b[x]) % 2 == 0)
{
a[(x + 1) % n] += (a[x] - b[x]) / 2;
a[x] = b[x];
}
else if (a[x] - b[x] > 1)
{
a[(x + 1) % n] += (a[x] - b[x]) / 2;
a[x] = b[x] + 1;
}
else if (a[x] - b[x] == 1)
{
a[(x + 1) % n] += 1;
a[x] = b[x] - 1;
}
}
}
// for (int x = 0; x < n; x++)
// {
// cout << a[x] << " ";
// }
// cout << "\n";
}
for (int x = 0; x < n; x++)
{
if (a[x] != b[x])
{
cout << "No\n";
return;
}
}
cout << "Yes\n";
}
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
// cin >> t;
for (int x = 1; x <= t; x++)
{
solve();
}
return 0;
}