#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e9 + 7;
const long long MAXL = 1e18;
const int N = 2 * 1e5 + 20;
const double eps = 1e-13;
struct Point {
  int x, y;
};
int n, k, q, l, r;
vector<bool> used;
vector<int> dp;
vector<vector<int> > v;
vector<Point> dot;
bool try12(Point a, Point b) {
  int A = a.y - b.y, B = b.x - a.x;
  int C = -A * a.x - B * a.y;
  vector<Point> next;
  for (int i = 0; i < n; ++i) {
    if ((dot[i].x == a.x) || (dot[i].x == b.x)) continue;
    int x = dot[i].x, y = dot[i].y;
    if (A * x + B * y + C) next.push_back(dot[i]);
  }
  if (next.size() == 0) return false;
  if (next.size() == 1) return true;
  a = next[0];
  b = next[1];
  int AA = a.y - b.y, BB = b.x - a.x;
  int CC = -AA * a.x - BB * a.y;
  if (AA * B != A * BB) return false;
  int add = 0;
  for (int i = 2; i < (int)next.size(); ++i) {
    int x = next[i].x, y = next[i].y;
    if (AA * x + BB * y + CC) add++;
  }
  if (add) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    Point a;
    cin >> a.y;
    a.x = i;
    dot.push_back(a);
  }
  if (try12(dot[0], dot[1]) || try12(dot[0], dot[2]) || try12(dot[1], dot[2]))
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
