#include <bits/stdc++.h>
using namespace std;
long long w[1000];
pair<long long, long long> w1[200003];
vector<char> v, ans;
map<long long, long long> M, M1;
double a, b, c, n, m, q, k, x, c1, b1;
long long poww(long long x, long long y) {
  if (x == 0) return 0;
  if (x == 1) return 1;
  if (y == 0) return 1;
  if (y == 1) return x;
  long long d = poww(x, y / 2);
  if (y % 2) return d * d * x;
  return d * d;
}
long long l, r, y;
long long inf = -999999999;
bool f(double x1, double y1, double mi, double c1) {
  if (y1 == x1 * mi + c1) return 1;
  if (a == inf) {
    a = y1 - x1 * mi;
    return 1;
  }
  if (y1 == x1 * mi + a) return 1;
  return 0;
}
bool anss;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> w[i];
  c1 = w[3] - w[2];
  b1 = w[2] - 2 * c1;
  for (int i = 2; i <= n; i++) {
    bool d4 = f(i, w[i], c1, b1);
    if (!d4) break;
    if (i == n) anss = 1;
  }
  for (int i = 2; i <= n; i++) {
    a = inf;
    c = (double)i - 1;
    double d = w[i] - w[1];
    d = d / c;
    double d1 = (double)w[1] - d;
    if (i == 2) {
      if (anss) {
        if (d != c1 || d1 != b1) return cout << "Yes", 0;
        if (d == c1 && d1 == b1) return cout << "No", 0;
      }
    }
    bool d2 = 1;
    for (int j = 1; j <= n; j++) {
      d2 = f(j, w[j], d, d1);
      if (!d2) break;
      if (j == n) return cout << "Yes", 0;
    }
  }
  cout << "No";
  return 0;
}
