#include <bits/stdc++.h>
using namespace std;
void pass() { return; }
mt19937 rnd(rand() << 15 + rand());
const long long MOD = 1e9 + 7;
const long long BIG_MOD = 1e18 + 7;
const long long MAXN = 1007;
long long gcd(long long a, long long b) {
  while (b) {
    long long tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}
bool check1(long long x1, long long y1, long long delt1, long long delt2,
            long long x2, long long y2) {
  long long deltx = x2 - x1;
  if (deltx % delt1) {
    return false;
  }
  if (y1 + (deltx / delt1) * delt2 != y2) {
    return false;
  }
  return true;
}
bool check(vector<pair<long long, long long> > a, long long d1, long long d2) {
  if (!a.size()) {
    return false;
  }
  if (a.size() == 1) {
    return true;
  }
  long long delt1 = a[1].first - a[0].first;
  long long delt2 = abs(a[1].second - a[0].second);
  long long div = gcd(delt1, delt2);
  delt1 /= div;
  delt2 /= div;
  if (a[1].second < a[0].second) {
    delt2 = -delt2;
  }
  if (!(delt1 == d1 && delt2 == d2)) {
    return false;
  }
  for (long long i = 2; i < a.size(); ++i) {
    if (!check1(a[0].first, a[0].second, delt1, delt2, a[i].first,
                a[i].second)) {
      return false;
    }
  }
  return true;
}
signed main() {
  cout.tie(NULL);
  cout.precision(20);
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<pair<long long, long long> > a(n);
  for (long long i = 0; i < n; ++i) {
    a[i].first = i + 1;
    cin >> a[i].second;
  }
  vector<pair<long long, long long> > p;
  long long delt1, delt2, div;
  p = {};
  delt1 = a[1].first - a[0].first;
  delt2 = abs(a[1].second - a[0].second);
  div = gcd(delt1, delt2);
  delt1 /= div;
  delt2 /= div;
  if (a[1].second < a[0].second) {
    delt2 = -delt2;
  }
  for (long long i = 2; i < n; ++i) {
    if (!check1(a[0].first, a[0].second, delt1, delt2, a[i].first,
                a[i].second)) {
      p.push_back(a[i]);
    }
  }
  if (check(p, delt1, delt2)) {
    cout << "Yes\n";
    return 0;
  }
  p = {};
  delt1 = a[2].first - a[0].first;
  delt2 = abs(a[2].second - a[0].second);
  div = gcd(delt1, delt2);
  delt1 /= div;
  delt2 /= div;
  if (a[2].second < a[0].second) {
    delt2 = -delt2;
  }
  if (!check1(a[0].first, a[0].second, delt1, delt2, a[1].first, a[1].second)) {
    p.push_back(a[1]);
  }
  for (long long i = 3; i < n; ++i) {
    if (!check1(a[0].first, a[0].second, delt1, delt2, a[i].first,
                a[i].second)) {
      p.push_back(a[i]);
    }
  }
  if (check(p, delt1, delt2)) {
    cout << "Yes\n";
    return 0;
  }
  p = {};
  delt1 = a[2].first - a[1].first;
  delt2 = abs(a[2].second - a[1].second);
  div = gcd(delt1, delt2);
  delt1 /= div;
  delt2 /= div;
  if (a[2].second < a[1].second) {
    delt2 = -delt2;
  }
  if (!check1(a[1].first, a[1].second, delt1, delt2, a[0].first, a[0].second)) {
    p.push_back(a[0]);
  }
  for (long long i = 3; i < n; ++i) {
    if (!check1(a[1].first, a[1].second, delt1, delt2, a[i].first,
                a[i].second)) {
      p.push_back(a[i]);
    }
  }
  if (check(p, delt1, delt2)) {
    cout << "Yes\n";
    return 0;
  }
  cout << "No\n";
  return 0;
}
