#include <bits/stdc++.h>
using namespace std;
long long a[1010];
int main(void) {
  int n;
  scanf("%d", &n);
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long chb2 = 0;
  if (a[3] - a[2] == a[2] - a[1]) {
    double k, b1 = a[1], b2 = 2e9;
    k = (double)a[2] - a[1];
    for (long long i = 4; i <= n; i++) {
      if (fabs(b2 - 2e9) < 1e-6) {
        if (fabs((i - 1) * k - (a[i] - b1)) < 1e-6)
          continue;
        else {
          b2 = a[i] - (i - 1) * k;
          chb2 = 1;
        }
      } else {
        if (fabs((i - 1) * k - (a[i] - b1)) < 1e-6)
          continue;
        else if (fabs((i - 1) * k - (a[i] - b2)) < 1e-6)
          continue;
        else {
          printf("no\n");
          return 0;
        }
      }
    }
    if (chb2 == 0) {
      printf("no\n");
      return 0;
    }
  } else {
    double k[5], b2[5];
    long long flag[5];
    k[1] = a[2] - a[1], k[2] = a[3] - a[2], k[3] = (a[3] - a[1]) / 2.0;
    flag[1] = flag[2] = flag[3] = 1;
    b2[1] = a[3] - 2 * k[1], b2[2] = a[2] - k[2], b2[3] = a[2] - k[3];
    for (long long i = 4; i <= n; i++) {
      for (long long j = 1; j <= 3; j++) {
        if (flag[j]) {
          if (fabs((i - 1) * k[j] - (a[i] - a[1])) < 1e-6)
            continue;
          else if (fabs((i - 1) * k[j] - (a[i] - b2[j])) < 1e-6)
            continue;
          else {
            flag[j] = 0;
          }
        }
      }
    }
    if (flag[1] == 0 && flag[2] == 0 && flag[3] == 0) {
      printf("no\n");
      return 0;
    }
  }
  printf("yes\n");
  return 0;
}
