#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int n, a[maxn], tmpx, tmpy;
int x1[maxn], x2[maxn];
bool vis[maxn];
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  x1[1] = a[1];
  for (int p = 1; p <= n; p++) {
    tmpx = p - 1;
    tmpy = a[p] - a[1];
    int tot = 0;
    memset(vis, 0, sizeof vis);
    for (int i = 1; i <= n; i++) x1[i] = x2[i] = 2e9;
    if (tmpx == 0) {
      bool ff = 1;
      int ttt = a[3] - a[2];
      for (int i = 3; i <= n; i++) {
        if (a[i] - a[i - 1] != ttt) {
          ff = 0;
          break;
        }
      }
      if (ff && a[2] - a[1] != ttt) {
        puts("Yes");
        return 0;
      }
      x1[1] = a[1];
      for (int i = 2; i <= n; i++) x1[i] = a[1];
      for (int i = 1; i <= n; i++) {
        if (x1[i] == a[i]) {
          tot++;
          vis[i] = 1;
        }
      }
      if (tot == n) continue;
      int pos = 1;
      while (vis[pos++])
        ;
      for (int i = 1; i <= n; i++) x2[i] = a[pos];
      for (int i = 1; i <= n; i++) {
        if (vis[i]) continue;
        if (x2[i] == a[i]) {
          tot++;
          vis[i] = 1;
        }
      }
      if (tot == n) {
        puts("Yes");
        return 0;
      }
    } else {
      int g = gcd(abs(tmpx), abs(tmpy));
      tmpx /= g;
      tmpy /= g;
      x1[1] = a[1];
      for (int i = 1 + tmpx; i <= n; i += tmpx) x1[i] = x1[i - tmpx] + tmpy;
      for (int i = 1; i <= n; i++) {
        if (x1[i] == a[i]) {
          tot++;
          vis[i] = 1;
        }
      }
      if (tot == n) continue;
      int pos = 1;
      while (vis[pos]) pos++;
      x2[pos] = a[pos];
      for (int i = pos + tmpx; i <= n; i += tmpx) x2[i] = x2[i - tmpx] + tmpy;
      for (int i = 1; i <= n; i++) {
        if (vis[i]) continue;
        if (x2[i] == a[i]) {
          tot++;
          vis[i] = 1;
        }
      }
      if (tot == n) {
        puts("Yes");
        return 0;
      }
    }
  }
  puts("No");
  return 0;
}
