#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  map<double, int> m1, m2;
  int maxi = 0;
  for (int i = 1; i < n; i++) {
    m1.clear();
    for (int j = 0; j < i; j++) {
      double slope = (double)(a[i] - a[j]) / (double)(i - j);
      if (m1[slope] == 0) m2[slope]++;
      m1[slope]++;
      maxi = max(maxi, m2[slope]);
    }
  }
  if (maxi == n - 2)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
