#include <bits/stdc++.h>
using namespace std;
int n, temp;
vector<int> a;
int check(int p1, int p2) {
  long double m = (long double)(a[p2] - a[p1]) / (long double)(p2 - p1), m1;
  int count = 2;
  vector<int> temp;
  for (int i = 1; i <= n; i++) {
    if (i == p1) continue;
    m1 = (long double)(a[i] - a[p1]) / (long double)(i - p1);
    if (m == m1 && i != p1 && i != p2)
      count++;
    else if (i != p1 && i != p2)
      temp.push_back(i);
  }
  if (count == n)
    return 0;
  else if (count == n - 1)
    return 1;
  else {
    for (int i = 1; i < temp.size(); i++) {
      m1 = (long double)(a[temp[0]] - a[temp[i]]) / (temp[0] - temp[i]);
      if (m != m1) return 0;
    }
  }
  return 1;
}
int main() {
  a.push_back(0);
  cin >> n;
  bool hash[n + 1];
  memset(hash, 0, sizeof(bool) * (n + 1));
  for (int i = 1; i <= n; i++) {
    cin >> temp;
    a.push_back(temp);
  }
  if (check(1, 2) || check(2, 3) || check(1, 3))
    cout << "yes\n";
  else
    cout << "no\n";
  return 0;
}
