#include <bits/stdc++.h>
using namespace std;
int n;
int a[2000];
bool check(double k) {
  int flag = -1;
  for (int i = 2; i <= n; i++) {
    if ((i - 1) * k == a[i] - a[1]) continue;
    if (flag == -1)
      flag = i;
    else {
      if (a[i] - a[flag] != (i - flag) * k) return false;
    }
  }
  return flag != -1;
}
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    if (check((a[3] - a[2]) / 1.0) || check((a[2] - a[1]) / 1.0) ||
        check((a[3] - a[1]) / 2.0)) {
      printf("Yes\n");
      continue;
    }
    printf("No\n");
  }
  return 0;
}
