#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, a[1007];
bool vis[1007];
bool check(double k, int b) {
  memset(vis, false, sizeof(vis));
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] - b == 1LL * k * (i - 1)) {
      vis[i] = true;
      ++cnt;
    }
  }
  if (cnt == n) return false;
  if (cnt == n - 1) return true;
  int pos1 = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i] && pos1 == 0) pos1 = i;
  for (int i = pos1 + 1; i <= n; i++)
    if (!vis[i]) {
      if (fabs((double)(a[i] - a[pos1]) / (i - pos1) - k) > 1e-7) return false;
    }
  return true;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  bool ans = false;
  ans |= check(1.0 * (a[2] - a[1]), a[1]);
  ans |= check(0.5 * (a[3] - a[1]), a[1]);
  ans |= check(1.0 * (a[3] - a[2]), a[2] * 2 - a[3]);
  if (ans)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
