#include <bits/stdc++.h>
inline int rd(void) {
  int f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  int x = 0;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int N = 1005;
int n, y[N];
bool vis[N];
inline long long det(int x, int y, int _x, int _y) {
  return 1LL * x * _y - 1LL * y * _x;
}
int main(void) {
  n = rd();
  for (register int i = (1); i <= (n); i++) y[i] = rd();
  for (register int i = (1); i <= (2); i++)
    for (register int j = (i + 1); j <= (n); j++) {
      memset(vis, 0, sizeof vis);
      int dx = j - i, dy = y[j] - y[i];
      for (register int k = (1); k <= (n); k++)
        if (!det(k - i, y[k] - y[i], dx, dy)) vis[k] = true;
      int cnt = 0;
      for (register int k = (1); k <= (n); k++) cnt += !vis[k];
      if (!cnt) continue;
      if (cnt == 1) return puts("Yes"), 0;
      int p = 0, q = 0;
      for (register int k = (1); k <= (n); k++)
        if (!vis[k] && (!p || !q)) !p ? p = k : q = k;
      int Dx = q - p, Dy = y[q] - y[p];
      if (det(Dx, Dy, dx, dy) != 0) continue;
      for (register int k = (1); k <= (n); k++)
        if (!det(Dx, Dy, k - p, y[k] - y[p])) vis[k] = true;
      cnt = 0;
      for (register int k = (1); k <= (n); k++) cnt += !vis[k];
      if (!cnt) return puts("Yes"), 0;
    }
  puts("No");
  return 0;
}
