/*input
2
1 1
2 2
*/
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
int main()
{
clock_t pradzia = clock();
ios_base::sync_with_stdio(false);
int n;
cin >> n;
ll a[n], b[n];
for (int i = 0; i < n; i++)
cin >> a[i] >> b[i];
while ((clock() - pradzia) * 10 <= 9 * CLOCKS_PER_SEC)
{
bool ok = true;
for (int i = n - 1; i >= 0; i--)
{
if (a[i] < b[i])
{
ll c = min(a[(i - 1 + n) % n] / 2, b[i] - a[i]);
a[i] += c;
a[(i - 1 + n) % n] -= 2 * c;
ok = false;
}
}
for (int i = 0; i < n; i++)
{
if (a[i] > b[i])
{
ll c = min(a[i] / 2, (a[i] - b[i] + 1) / 2);
a[i] -= c * 2;
a[(i + 1) % n] += c;
ok = false;
}
}
if (ok)
{
cout << "Yes\n";
return 0;
}
}
cout << "No\n";
}
LyppbnB1dAoyCjEgMQoyIDIKKi8KI3ByYWdtYSBHQ0Mgb3B0aW1pemUgKCJPMyIpCiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgojaW5jbHVkZSA8ZXh0L3BiX2RzL2Fzc29jX2NvbnRhaW5lci5ocHA+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnVzaW5nIG5hbWVzcGFjZSBfX2dudV9wYmRzOwp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKdHlwZWRlZiBsb25nIGRvdWJsZSBsZDsKaW50IG1haW4oKQp7CgljbG9ja190IHByYWR6aWEgPSBjbG9jaygpOwoJaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CglpbnQgbjsKCWNpbiA+PiBuOwoJbGwgYVtuXSwgYltuXTsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKQoJCWNpbiA+PiBhW2ldID4+IGJbaV07Cgl3aGlsZSAoKGNsb2NrKCkgLSBwcmFkemlhKSAqIDE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