#include <bits/stdc++.h>
using namespace std;
long long a[1010];
bool mark[1010];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long num = a[3] - a[2];
  long long den = 1;
  bool yes = true;
  for (int i = 4; i <= n; i++) {
    long long n1 = a[i] - a[2];
    long long d1 = i - 2;
    if (num * d1 != n1 * den) {
      yes = false;
      break;
    }
  }
  long long n2 = a[2] - a[1];
  long long d2 = 1;
  if (yes and num * d2 != den * n2) {
    cout << "YES"
         << "\n";
    return 0;
  }
  mark[1] = true;
  yes = false;
  for (int i = 2; i <= n; i++) {
    yes = false;
    long long num = a[i] - a[1];
    long long den = i - 1;
    for (int j = 2; j <= n; j++) mark[j] = false;
    mark[i] = true;
    for (int j = 2; j <= n; j++) {
      long long n1 = a[j] - a[1];
      long long d1 = j - 1;
      if (num * d1 == n1 * den) mark[j] = true;
    }
    vector<long long> aux;
    for (int j = 2; j <= n; j++) {
      if (!mark[j]) aux.push_back(j);
    }
    if (aux.size() >= 2) {
      long long num2 = a[aux[1]] - a[aux[0]];
      long long den2 = aux[1] - aux[0];
      yes = true;
      for (int j = 2; j < aux.size(); j++) {
        long long n1 = a[aux[j]] - a[aux[0]];
        long long d1 = aux[j] - aux[0];
        if (num2 * d1 != den2 * n1) {
          yes = false;
          break;
        }
      }
      if (yes and num * den2 == den * num2) {
        break;
      }
    } else if (aux.size() == 1) {
      yes = true;
      break;
    }
    yes = false;
  }
  if (yes)
    cout << "Yes"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
