#include <bits/stdc++.h>
using namespace std;
pair<int, int> slopes[1010][1010];
int N, y[1010];
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", y + i);
  bool flag = true;
  if (N == 1) {
    flag = false;
  } else if (N == 2) {
    flag = true;
  }
  if (N <= 2) {
    puts(flag ? "Yes" : "No");
    return 0;
  }
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= N; j++) {
      if (i == j) continue;
      int p = y[i] - y[j], q = i - j, g = gcd(abs(p), abs(q));
      if (q < 0) p = -p, q = -q;
      p /= g, q /= g;
      slopes[i][j] = pair<int, int>(p, q);
    }
  for (int i = 2; i <= N; i++) {
    pair<int, int> S = slopes[1][i];
    bool flag = true;
    vector<int> V;
    for (int j = 2; j <= N; j++) {
      if (i == j) continue;
      if (S != slopes[1][j]) V.push_back(j);
    }
    if (V.empty()) continue;
    if ((int)V.size() == 1) {
      puts("Yes");
      return 0;
    }
    for (int j = 1; j < (int)V.size(); j++) {
      if (S != slopes[V[0]][V[j]]) {
        flag = false;
      }
    }
    if (flag) {
      puts("Yes");
      return 0;
    }
  }
  pair<int, int> S = slopes[2][3];
  flag = true;
  for (int i = 4; i <= N; i++) {
    if (slopes[2][i] != S) flag = false;
  }
  flag &= S != slopes[1][2];
  puts(flag ? "Yes" : "No");
  return 0;
}
