#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 20;
struct coor {
  long long int x, y;
} a[maxn], b[maxn];
int vis[maxn], DFN = 1;
int n;
bool same(int i, int j, int k) {
  return (a[j].y - a[i].y) * (a[k].x - a[i].x) ==
         (a[k].y - a[i].y) * (a[j].x - a[i].x);
}
bool init(int one, int two) {
  ++DFN;
  vis[one] = vis[two] = DFN;
  for (int i = 1; i <= n; ++i) {
    if (vis[i] == DFN) continue;
    if (same(one, two, i)) {
      vis[i] = DFN;
    }
  }
  int lenb = 0;
  for (int i = 1; i <= n; ++i) {
    if (vis[i] == DFN) continue;
    if (lenb == 0)
      b[++lenb] = a[i];
    else {
      b[++lenb] = a[i];
      if ((a[two].y - a[one].y) * (b[lenb].x - b[1].x) !=
          (b[lenb].y - b[1].y) * (a[two].x - a[one].x)) {
        return false;
      }
    }
  }
  return lenb != 0;
}
void work() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", &a[i].y);
    a[i].x = i;
  }
  for (int i = 1; i <= 3; ++i) {
    for (int j = i + 1; j <= 3; ++j) {
      if (init(i, j)) {
        printf("Yes\n");
        return;
      }
    }
  }
  printf("No\n");
}
int main() {
  work();
  return 0;
}
