#include <bits/stdc++.h>
using namespace std;
double m1, m2, b1, b2, l1, l2;
vector<int> v;
int main() {
  int n;
  cin >> n;
  double ar[1005];
  for (int i = 1; i <= n && cin >> ar[i]; ++i)
    ;
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      m1 = (ar[j] - ar[i]) / (j - i);
      b1 = ar[i] - (m1 * i);
      vector<int> v;
      for (int k = 1; k <= n; k++) {
        l1 = (m1 * k) + b1;
        if (ar[k] != l1) v.push_back(k);
      }
      if (v.empty()) break;
      if (v.size() == 1) {
        cout << "Yes" << endl;
        exit(0);
      }
      vector<int>::iterator it = v.begin() + 1, pr = v.begin();
      m2 = (ar[*it] - ar[*pr]) / (*it - *pr);
      b2 = ar[*pr] - (m2 * (*pr));
      if (m1 != m2) break;
      for (it = v.begin(); it < v.end(); ++it) {
        l2 = (m2 * (*it)) + b2;
        if (ar[*it] != l2) break;
      }
      if (it == v.end()) {
        cout << "Yes" << endl;
        exit(0);
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
