#include <bits/stdc++.h>
using namespace std;
int n;
pair<long long, long long> pts[1001];
bool ok[1001];
map<double, int> mcnt;
bool valid() {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (i == j) continue;
      double m =
          1.0 * (pts[i].second - pts[j].second) / (pts[i].first - pts[j].first);
      if (mcnt.count(m))
        ++mcnt[m];
      else
        mcnt[m] = 1;
    }
  }
  int max_cnt = 0;
  double max_m;
  for (auto it : mcnt) {
    if (it.second > max_cnt) {
      max_cnt = it.second;
      max_m = it.first;
    }
  }
  ok[1] = 1;
  for (int i = 2; i <= n; ++i) {
    double m =
        1.0 * (pts[i].second - pts[1].second) / (pts[i].first - pts[1].first);
    if (m == max_m) ok[i] = 1;
  }
  int next_start = -1;
  for (int i = 2; i <= n; ++i) {
    if (!ok[i]) {
      next_start = i;
      break;
    }
  }
  if (next_start == -1) return 0;
  ok[next_start] = 1;
  for (int i = next_start + 1; i <= n; ++i) {
    if (ok[i]) continue;
    double m = 1.0 * (pts[i].second - pts[next_start].second) /
               (pts[i].first - pts[next_start].first);
    if (m == max_m) ok[i] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    if (!ok[i]) {
      return 0;
    }
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    pts[i].first = i;
    cin >> pts[i].second;
  }
  cout << (valid() ? "Yes" : "No") << endl;
  return 0;
}
