#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
struct node {
  int a, index;
};
vector<node> v;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  bool flag = false;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      double k = 1.0 * (a[2] - a[1]) / (2 - 1);
      double x = 1.0 * (a[1] - a[0]) / (1 - 0);
      if (fabs(x - k) <= 1e-6) {
        continue;
      }
      for (int j = 2; j < n; j++) {
        if (1.0 * (a[j] - a[1]) / (j - 1) != k) {
          break;
        } else if (j + 1 == n) {
          flag = true;
        }
      }
    } else {
      v.clear();
      double k = 1.0 * (a[i] - a[0]) / (i - 0);
      for (int j = 1; j < n; j++) {
        if (1.0 * (a[j] - a[0]) / (j - 0) != k) {
          v.push_back(node{a[j], j});
        }
      }
      int size = v.size();
      double kk;
      if (size == 1)
        flag = true;
      else if (size > 1) {
        kk = 1.0 * (v[1].a - v[0].a) / (v[1].index - v[0].index);
        if (kk != k)
          continue;
        else if (size == 2)
          flag = true;
      }
      for (int i = 2; i < size; i++) {
        if (1.0 * (v[i].a - v[0].a) / (v[i].index - v[0].index) != kk) {
          break;
        } else if (i + 1 >= size) {
          flag = true;
        }
      }
    }
    if (flag) break;
  }
  if (flag)
    puts("Yes");
  else
    puts("No");
  return 0;
}
