#include <bits/stdc++.h>
using namespace std;
int p[1005];
bool jugde(double k, int n) {
  int m = -1;
  for (int i = 2; i <= n; i++) {
    if (p[i] - p[1] == (i - 1) * k) continue;
    if (m == -1)
      m = i;
    else if (p[i] - p[m] != (i - m) * k) {
      return 0;
    }
  }
  return m != -1;
}
int main() {
  int n = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
  }
  if (jugde(1.0 * (p[2] - p[1]), n) || jugde(1.0 * (p[3] - p[1]) / 2, n) ||
      jugde(1.0 * (p[3] - p[2]), n)) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
