#include <bits/stdc++.h>
using namespace std;
long long n;
bool cmp(bool judge[], long long a[], long long x1, long long x2) {
  judge[x1] = 1;
  judge[x2] = 1;
  for (long long z = 1; z <= n; z++) {
    if (!judge[z]) {
      if ((a[z] - a[x1]) * (x2 - x1) == (a[x2] - a[x1]) * (z - x1))
        judge[z] = 1;
    }
  }
  long long num = 0;
  for (long long z = 1; z <= n; z++)
    if (judge[z]) num++;
  if (num == n) return 0;
  if (num == n - 1) return 1;
  long long X1, X2, NUM = 0;
  for (long long z = 1; z <= n; z++) {
    if (NUM == 0 && !judge[z]) {
      X1 = z;
      NUM++;
      continue;
    }
    if (NUM == 1 && !judge[z]) {
      X2 = z;
      break;
    }
  }
  judge[X1] = judge[X2] = 1;
  for (long long z = 1; z <= n; z++) {
    if (!judge[z]) {
      if ((a[z] - a[X1]) == ((a[X2] - a[X1]) * (z - X1) / (X2 - X1)))
        judge[z] = 1;
    }
  }
  for (long long z = 1; z <= n; z++)
    if (!judge[z]) return 0;
  if ((X1 - X2) * (a[x1] - a[x2]) == (x1 - x2) * (a[X1] - a[X2]))
    return 1;
  else
    return 0;
}
int main() {
  while (scanf("%lld", &n) != EOF) {
    long long num = 0, a[1010], z0 = 1;
    bool judge[1010] = {0}, JU = 0;
    for (long long z = 1; z <= n; z++) scanf("%lld", &a[z]);
    for (long long z = 1; z <= 2; z++) {
      for (long long x = 1; x <= 4; x++) {
        memset(judge, 0, sizeof(judge));
        if (JU) break;
        if (z == x) continue;
        JU = cmp(judge, a, z, x);
      }
    }
    if (JU)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
