#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  long double arr[n + 1];
  for (int i = 1; i <= n; i++) cin >> arr[i];
  if (n == 3) {
    set<long double> s;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        s.insert((arr[j] - arr[i]) / (j - i));
      }
    }
    if (s.size() == 1)
      cout << "No";
    else
      cout << "Yes";
    return 0;
  }
  if (n == 4) {
    set<long double> s;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        s.insert((arr[j] - arr[i]) / (j - i));
      }
    }
    if (s.size() == 6)
      cout << "No";
    else
      cout << "Yes";
    return 0;
  }
  long double slope = 0;
  int idx = -1;
  long long cnt = -1;
  for (int i = 1; i <= n; i++) {
    map<long double, long long> mm;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      mm[(arr[j] - arr[i]) / (j - i)]++;
    }
    long long val = cnt;
    long double tp = 0;
    for (auto it : mm) {
      if (it.second > val) tp = it.first, val = it.second;
    }
    if (idx == -1)
      idx = i, slope = tp;
    else {
      if (val > cnt) cnt = val, slope = tp, idx = i;
    }
  }
  vector<int> v;
  for (int i = 1; i <= n; i++) {
    if (i == idx) continue;
    if ((arr[i] - arr[idx]) / (i - idx) != slope) v.push_back(i);
  }
  set<long double> s;
  for (int i = 0; i < v.size(); i++) {
    for (int j = i + 1; j < v.size(); j++) {
      s.insert((arr[v[j]] - arr[v[i]]) / (v[j] - v[i]));
    }
  }
  if (cnt == n - 1)
    cout << "No";
  else if (s.empty())
    cout << "Yes";
  else if (s.size() == 1) {
    if (*s.begin() == slope)
      cout << "Yes";
    else
      cout << "No";
  } else
    cout << "No";
  return 0;
}
