#include <bits/stdc++.h>
using namespace std;
int a[1006], n, vis[1005];
double k1, k2;
int main() {
  scanf("%d", &n);
  bool flag = false;
  int pos = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] - 0 == 0) pos++;
  }
  if (pos == n - 1) flag = true;
  for (int i = 1; i <= n; i++) {
    memset(vis, 0, sizeof(vis));
    vis[1] = 1, vis[i] = 1;
    k1 = ((a[i] - a[1]) * (1.0)) / ((i - 1) * 1.0);
    int ans = 1;
    for (int j = 2; j <= n; j++) {
      if (((a[j] - a[1]) * (1.0)) / ((j - 1) * 1.0) == k1) vis[j] = 1, ans++;
    }
    int ok = 0, xx = -1;
    for (int j = 1; j <= n; j++) {
      if (vis[j] == 0 && ok == 0)
        xx = j, ok++;
      else if (ok == 1 && vis[j] == 0)
        k2 = ((a[j] - a[xx]) * (1.0)) / ((j - xx) * 1.0), ok++;
      else if (ok >= 2 && vis[j] == 0) {
        if (((a[j] - a[xx]) * (1.0)) / ((j - xx) * 1.0) == k2) ok++;
      }
    }
    if ((ans + ok == n && ok && k1 == k2) || ans == n - 1 || ok == n - 1)
      flag = true;
    if (ans == n || ok == n) {
      flag = false;
      goto k;
    }
  }
k:
  puts(flag ? "Yes" : "No");
  return 0;
}
