#include <bits/stdc++.h>
using namespace std;
double a[1000005];
set<double> se;
set<int> se2;
int main() {
  int i, j, k, l, m, n, t, r, cnt;
  int flag;
  long long ans, an;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (t = 0; t < 1000; t++) {
    l = rand() % n;
    r = rand() % n;
    while (r == l) {
      r = rand() % n;
    }
    se.clear();
    se2.clear();
    se.insert((a[l] - a[r]) / (l - r));
    for (i = 0; i < n; i++) {
      if (i == l) {
        continue;
      }
      if (se.find((a[l] - a[i]) / (l - i)) != se.end()) {
      } else {
        se2.insert(i);
      }
    }
    if (se2.size() == 0) {
      cout << "No" << endl;
      return 0;
    }
    if (se2.size() == 1) {
      cout << "Yes" << endl;
      return 0;
    } else {
      l = *(se2.begin());
      r = *(++se2.begin());
      double in = (a[l] - a[r]) / (l - r);
      if (in != *(se.begin())) {
        continue;
      }
      flag = 0;
      for (auto it : se2) {
        if (it == l) {
          continue;
        }
        if (((a[l] - a[it]) / (l - it)) != in) {
          flag = 1;
          break;
        }
      }
      if (flag == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}
