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