#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100000], b, ans = 0;
  cin >> n;
  for (b = 0; b < n; b++) {
    cin >> a[b];
    a[b + 3] = a[b];
  }
  for (int i = 1; i < n * 2; i++) {
    if (a[i - 1] + a[i + 1] == a[i]) {
      ans++;
    } else if (a[i - 1] - a[i + 1] == a[i]) {
      ans++;
    } else if (a[i + 1] - a[i - 1] == a[i]) {
      ans++;
    }
  }
  if (ans == n * 2 - 2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
