#include <bits/stdc++.h>
using namespace std;
long long a[11000];
struct point {
  long long x;
  long long y;
} b[10010];
long long c[10010];
long long d[10100];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
    }
    long long o1 = 0, o2 = 0;
    long long sum1 = 0, sum2 = 0, sum3 = 0, sum4 = 0, sum5 = 0;
    for (int i = 2; i <= n; i++) {
      b[i].x = a[i] - a[1];
      b[i].y = i - 1;
    }
    memset(c, 0, sizeof(c));
    for (int i = 2; i <= n; i++) {
      c[i] = 1;
      sum1 = 1;
      for (int j = i + 1; j <= n; j++) {
        if (b[i].x * b[j].y == b[i].y * b[j].x) {
          o1 = b[i].x;
          o2 = b[i].y;
          sum1++;
          c[j] = 1;
        }
      }
      if (sum1 >= 2) {
        break;
      }
      memset(c, 0, sizeof(c));
    }
    int k = 0;
    for (int i = 2; i <= n; i++) {
      if (c[i] == 0) {
        d[k++] = i;
      }
    }
    if (k == 0)
      printf("No\n");
    else if (k == 1) {
      printf("Yes\n");
    } else {
      int flag = 0;
      long long x = a[d[1]] - a[d[0]];
      long long y = d[1] - d[0];
      sum2 = 0;
      long long e1, e2;
      for (int i = 2; i < k; i++) {
        long long t1 = a[d[i]] - a[d[0]];
        long long t2 = d[i] - d[0];
        if (t1 * y != t2 * x) {
          flag = 1;
          sum2++;
          e1 = i;
        }
      }
      if (sum2 == 1 && k == n - 1) {
        long long r1 = a[d[e1]] - a[1];
        long long r2 = d[e1] - 1;
        if (r1 * y == r2 * x)
          printf("Yes\n");
        else
          printf("No\n");
      } else {
        if (x * o2 != y * o1) {
          flag = 1;
        }
        if (flag == 1)
          printf("No\n");
        else
          printf("Yes\n");
      }
    }
  }
}
