#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
const double eps = 1e-8;
long long a[N];
int father[N], b[N], c[N], f[N];
int n, cnt = 0, ans = 0;
double cc[N];
vector<int> v[N];
int getfather(int x) {
  return father[x] ? father[x] = getfather(father[x]) : x;
}
int main() {
  scanf("%d", &n);
  for (int i(1); i <= (n); ++i) scanf("%lld", a + i);
  for (int i(2); i <= (n - 1); ++i) {
    for (int j(i + 1); j <= (n); ++j) {
      if ((long long)(i - 1) * (a[j] - a[1]) ==
          (long long)(j - 1) * (a[i] - a[1])) {
        int fa = getfather(i), fb = getfather(j);
        if (fa ^ fb) {
          father[fa] = fb;
        }
      }
    }
  }
  for (int i(2); i <= (n); ++i) {
    int x = getfather(i);
    if (!c[x]) {
      c[x] = ++cnt;
      v[cnt].push_back(i);
    } else
      v[c[x]].push_back(i);
  }
  ans = 0;
  for (int i(1); i <= (cnt); ++i) {
    if ((int)v[i].size() == n - 1) continue;
    memset(b, 0, sizeof b);
    double AA = (double)(a[v[i][0]] - a[1]) / (v[i][0] - 1);
    for (auto u : v[i]) b[u] = 1;
    int now = 0;
    for (int j(2); j <= (n); ++j)
      if (!b[j]) f[++now] = j;
    if (now == 1) {
      ans = 1;
      break;
    }
    int ff = 0;
    for (int j(2); j <= (now); ++j)
      cc[++ff] = (double)(a[f[j]] - a[f[1]]) / (double)(f[j] - f[1]);
    sort(cc + 1, cc + ff + 1);
    bool fl = true;
    for (int j(1); j <= (ff - 1); ++j)
      if (fabs(cc[j + 1] - cc[j]) > eps) {
        fl = false;
        continue;
      }
    if (!fl) continue;
    if (fabs(AA - cc[1]) < eps) {
      ans = 1;
      break;
    }
  }
  int ff = 0;
  for (int j(3); j <= (n); ++j)
    cc[++ff] = (double)(a[j] - a[2]) / (double)(j - 2);
  sort(cc + 1, cc + ff + 1);
  bool fl = true;
  for (int j(1); j <= (ff - 1); ++j)
    if (fabs(cc[j + 1] - cc[j]) > eps) {
      fl = false;
      break;
    }
  if (fl) {
    double AA = (double)(a[2] - a[1]);
    if (fabs(AA - cc[1]) > eps) ans = 1;
  }
  puts(ans ? "Yes" : "No");
  return 0;
}
