#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 7;
const int maxN = 2e5 + 5;
int a, b, n, arr[maxN], gcdAns[maxN];
vector<int> graph[maxN];
set<int> gcds[maxN];
int ans[maxN];
bool used[maxN];
pair<double, double> count(int j, int i) {
  double a = (double)(arr[j] - arr[i]) / (double)(j - i);
  double b = (arr[j] - j * a);
  return pair<double, double>(a, b);
}
void ex() {
  cout << "Yes\n";
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = (1); i <= ((n)); ++i) {
    cin >> arr[i];
  }
  for (int x = (1); x <= (2); ++x) {
    for (int i = (x + 1); i <= (n); ++i) {
      vector<int> wek;
      for (int j = (1); j <= ((n)); ++j) used[j] = false;
      pair<double, double> p = count(x, i);
      used[i] = true;
      used[x] = true;
      for (int j = (x + 1); j <= (n); ++j) {
        if (count(x, j) == p) used[j] = true;
      }
      for (int j = (1); j <= (n); ++j) {
        if (!used[j]) wek.push_back(j);
      }
      if ((int)wek.size() >= 2) {
        pair<double, double> p2 = count(wek[0], wek[1]);
        bool pom = true;
        if (p2.first != p.first) continue;
        for (int j = (1); j <= ((int)wek.size() - 1); ++j) {
          if (count(wek[0], wek[j]) != p2) {
            pom = false;
            break;
          }
        }
        if (pom) ex();
      } else {
        if ((int)wek.size() == 1) {
          if (p.first * wek[0] + p.second != arr[wek[0]]) ex();
        }
      }
    }
  }
  cout << "No\n";
  return 0;
}
