#include <bits/stdc++.h>
int y[1005] = {0}, n;
int check(double k) {
  int flag = 0, point = -1;
  for (int i = 2; i <= n; i++) {
    if (y[i] - y[1] == k * (i - 1)) continue;
    flag = 1;
    if (point < 0)
      point = i;
    else if (y[i] - y[point] != k * (i - point)) {
      flag = 0;
      break;
    }
  }
  if (flag)
    return 1;
  else
    return 0;
}
int main() {
  int i;
  while (~scanf("%d", &n)) {
    memset(y, 0, sizeof(y));
    for (i = 1; i <= n; i++) scanf("%d", &y[i]);
    double k1 = 1.0 * (y[2] - y[1]);
    double k2 = 1.0 * (y[3] - y[2]);
    double k3 = 0.5 * (y[3] - y[1]);
    if (check(k1) || check(k2) || check(k3))
      printf("Yes\n");
    else
      printf("No\n");
  }
}
