#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (a && b) {
    a %= b;
    swap(a, b);
  }
  return a + b;
}
void solve() {
  int n;
  cin >> n;
  vector<long long> y(n);
  for (int i = 0; i < n; ++i) cin >> y[i];
  map<pair<long long, long long>, int> cnt;
  vector<vector<pair<long long, long long>>> vals(
      n, vector<pair<long long, long long>>(n));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) continue;
      pair<long long, long long> v = make_pair(i - j, y[i] - y[j]);
      long long g = gcd(v.first, v.second);
      v.first /= g;
      v.second /= g;
      vals[i][j] = v;
      ++cnt[v];
    }
  }
  pair<long long, long long> best;
  int bestCnt = -1;
  for (auto v : cnt) {
    if (v.second > bestCnt) {
      bestCnt = v.second;
      best = v.first;
    }
  }
  vector<int> ids(n, -1);
  int id = 0;
  while (id < 3) {
    int z = -1;
    for (int i = 0; i < n; ++i) {
      if (ids[i] == -1) {
        z = i;
        break;
      }
    }
    if (z == -1) break;
    ids[z] = id;
    for (int j = 0; j < n; ++j) {
      if (ids[j] != -1) continue;
      if (vals[z][j] != best) continue;
      ids[j] = id;
    }
    ++id;
  }
  puts(id == 2 ? "Yes" : "No");
}
int main() {
  srand(132456);
  solve();
  return 0;
}
