#include <bits/stdc++.h>
using namespace std;
double eps = 1e-8;
vector<vector<int>> g;
vector<int> vec;
int n;
bool how_parallel(int i, int j) {
  bool res = false;
  int cnt = 0;
  double k, b;
  vector<int> prl(n, 0);
  k = static_cast<double>(vec[i] - vec[j]) / (i - j);
  b = vec[i] - k * i;
  for (int ii = 0; ii < n; ++ii) {
    if (abs(k * ii + b - vec[ii]) < eps) {
      prl[ii] = 1;
      ++cnt;
    }
  }
  if (n - cnt == 0) {
  } else if (n - cnt == 1)
    res = true;
  else {
    bool ifres = false;
    double ifk, ifb;
    int q = -1, p = -1;
    for (int i = 0; i < n; ++i) {
      if (prl[i] != 1) {
        if (q == -1)
          q = i;
        else if (p == -1) {
          p = i;
          ifk = static_cast<double>(vec[p] - vec[q]) / (p - q);
          ifb = vec[p] - ifk * p;
          if (abs(ifk - k) >= eps)
            break;
          else {
            prl[p] = prl[q] = 2;
            cnt += 2;
          }
        } else {
          if (abs(k * i + ifb - vec[i]) < eps) {
            prl[i] == 2;
            ++cnt;
          }
        }
      }
    }
    if (cnt == n) res = true;
  }
  return res;
}
void solve() {
  int r, d, x, y, rad, l;
  cin >> n;
  vec.assign(n, 0);
  for (int i = 0; i < n; ++i) {
    cin >> vec[i];
  }
  bool ans = false;
  for (int i = 0; !ans && i < 2; ++i)
    for (int j = i + 1; !ans && j < n; ++j) {
      ans = how_parallel(i, j);
    }
  if (ans)
    cout << "Yes\n";
  else
    cout << "No\n";
}
int main() {
  int t = 1;
  for (int i = 0; i < t; ++i) solve();
}
