#include <bits/stdc++.h>
using namespace std;
unsigned long long over = 1000000007;
bool check(signed long long a, signed long long b, signed long long n,
           signed long long y[]) {
  bool ison[n];
  signed long long gy = y[b] - y[a], gx = b - a;
  signed long long cnt = 0;
  for (signed long long i = 0; i < n; ++i) {
    if (i == a || i == b) {
      ison[i] = true;
      continue;
    }
    if (y[i] == (y[a] + (gy * (i - a)) / gx) && (gy * (i - a)) % gx == 0) {
      ison[i] = true;
    } else {
      ison[i] = false;
      cnt++;
    }
  }
  if (cnt == 0) return false;
  if (cnt == 1) return true;
  signed long long a2 = -1, b2 = -1;
  for (signed long long i = 0; i < n; ++i) {
    if (!ison[i]) {
      if (a2 == -1)
        a2 = i;
      else {
        b2 = i;
        break;
      }
    }
  }
  signed long long gy2 = y[b2] - y[a2], gx2 = b2 - a2;
  if (gy * gx2 != gy2 * gx) {
    return false;
  }
  for (signed long long i = 0; i < n; ++i) {
    if (ison[i]) continue;
    if (i == a2 || i == b2) continue;
    if (y[i] == y[a2] + gy2 * (i - a2) / gx2 && (gy2 * (i - a2)) % gx2 == 0)
      continue;
    else {
      return false;
    }
  }
  return true;
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  signed long long n;
  cin >> n;
  signed long long y[n];
  for (signed long long i = 0; i < n; ++i) cin >> y[i];
  bool ans01 = check(0, 1, n, y), ans02 = check(0, 2, n, y),
       ans12 = check(1, 2, n, y);
  if (ans01 || ans02 || ans12)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
