#include <bits/stdc++.h>
using namespace std;
double eps = 1e-10;
bool eq(double d1, double d2) { return abs(d1 - d2) < eps; }
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  vector<bool> vb(n);
  for (int i = 1; i < n; i++) {
    fill(vb.begin(), vb.end(), false);
    double d = 1.0 * (a[i] - a[0]) / i;
    for (int j = 1; j < n; j++) {
      double cur = 1.0 * (a[j] - a[0]) / j;
      if (eq(d, cur)) vb[j] = true;
    }
    int first = -1;
    bool check = true;
    for (int j = 1; j < n; j++) {
      if (vb[j]) continue;
      if (first == -1) {
        first = j;
      } else {
        double cur = 1.0 * (a[j] - a[first]) / (j - first);
        if (!eq(d, cur)) check = false;
      }
    }
    if (first == -1) {
      printf("No");
      return 0;
    }
    if (first != -1 && check) {
      printf("Yes");
      return 0;
    }
  }
  double d = 1.0 * (a[2] - a[1]);
  for (int i = 3; i < n; i++) {
    double cur = 1.0 * (a[i] - a[1]) / (i - 1);
    if (!eq(cur, d)) {
      printf("No");
      return 0;
    }
  }
  printf("Yes");
}
