#include <bits/stdc++.h>
using namespace std;
const int maxn = 1100;
int n;
int y[maxn];
double solve(double k) {
  int point = -1;
  bool flag = false;
  for (int i = 2; i <= n; i++) {
    if (y[i] - y[1] == k * (i - 1)) continue;
    flag = true;
    if (point < 0)
      point = i;
    else if (point && y[i] - y[point] != k * (i - point)) {
      flag = false;
      break;
    }
  }
  if (flag)
    return true;
  else
    return false;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", y + i);
  double k1 = 1.0 * (y[2] - y[1]);
  double k2 = 0.5 * (y[3] - y[1]);
  double k3 = 1.0 * (y[3] - y[2]);
  if (solve(k1) || solve(k2) || solve(k3))
    cout << "Yes";
  else
    cout << "No";
}
