#include <bits/stdc++.h>
using namespace std;
void get(int &v) {
  char c;
  while ((c = getchar()) != EOF && isdigit(c) == 0)
    ;
  v = c - '0';
  while ((c = getchar()) != EOF && isdigit(c))
    v = (v << 1) + (v << 3) + c - '0';
  return;
}
int get() {
  int v;
  char c;
  while ((c = getchar()) != EOF && isdigit(c) == 0)
    ;
  v = c - '0';
  while ((c = getchar()) != EOF && isdigit(c))
    v = (v << 1) + (v << 3) + c - '0';
  return v;
}
int a[1000 + 80];
int close(double x, double y) { return x < y + 1e-2 && y < x + 1e-2; }
int main() {
  int n, i, j;
  double kk, b1, b2;
  bool flag;
  get(n);
  for (i = 1; i <= n; i++) scanf("%d", a + i);
  for (i = 2; i <= n; i++) {
    kk = (a[i] - a[1]) / (i - 1.0);
    flag = 0;
    b1 = a[1] - 1 * kk;
    for (j = 1; j <= n; j++) {
      if (close(a[j], kk * j + b1)) continue;
      if (flag && close(a[j], kk * j + b2)) continue;
      if (flag)
        break;
      else {
        flag = 1;
        b2 = a[j] - kk * j;
      }
    }
    if (j > n && flag) goto YES;
  }
  for (i = 3; i <= n; i++) {
    kk = (a[i] - a[2]) / (i - 2.0);
    flag = 0;
    b1 = a[2] - 2 * kk;
    for (j = 1; j <= n; j++) {
      if (close(a[j], kk * j + b1)) continue;
      if (flag && close(a[j], kk * j + b2)) continue;
      if (flag)
        break;
      else {
        flag = 1;
        b2 = a[j] - kk * j;
      }
    }
    if (j > n && flag) goto YES;
  }
  if (0)
  YES:
    puts("Yes");
  else
    puts("NO");
  return 0;
}
