#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  vector<int> line2(0);
  double m, d;
  int s;
  double k1 = ((double)vec[0] - vec[1]) / ((double)1 - 2);
  double b1 = vec[0] - k1;
  for (int i = 2; i < n; i++) {
    if (vec[i] != k1 * (i + 1) + b1) {
      line2.push_back(i);
    }
  }
  if (line2.size() == 1) {
    cout << "Yes";
    return 0;
  }
  if (line2.size() >= 2) {
    m = ((double)vec[line2[0]] - vec[line2[1]]) / ((double)line2[0] - line2[1]);
    if (m == k1) {
      d = vec[line2[0]] - m * (line2[0] + 1);
      s = 0;
      for (int i = 2; i < line2.size(); i++) {
        if (vec[line2[i]] != m * (line2[i] + 1) + d) s = 1;
      }
    }
    if (s == 0) {
      cout << "Yes";
      return 0;
    }
  }
  line2.resize(0);
  double k2 = ((double)vec[0] - vec[2]) / ((double)1 - 3);
  double b2 = vec[0] - k2;
  if (vec[1] != k2 * (2) + b2) line2.push_back(1);
  for (int i = 3; i < n; i++) {
    if (vec[i] != k2 * (i + 1) + b2) {
      line2.push_back(i);
    }
  }
  if (line2.size() == 1) {
    cout << "Yes";
    return 0;
  }
  if (line2.size() >= 2) {
    m = ((double)vec[line2[0]] - vec[line2[1]]) / ((double)line2[0] - line2[1]);
    if (m == k2) {
      d = vec[line2[0]] - m * (line2[0] + 1);
      s = 0;
      for (int i = 2; i < line2.size(); i++) {
        if (vec[line2[i]] != m * (line2[i] + 1) + d) s = 1;
      }
    }
    if (s == 0) {
      cout << "Yes";
      return 0;
    }
  }
  line2.resize(0);
  double k3 = ((double)vec[1] - vec[2]) / ((double)1 - 2);
  double b3 = vec[1] - k3 * 2;
  if (vec[0] != k3 + b3) {
    line2.push_back(0);
  }
  for (int i = 3; i < n; i++) {
    if (vec[i] != k3 * (i + 1) + b3) {
      line2.push_back(i);
    }
  }
  if (line2.size() == 1) {
    cout << "Yes";
    return 0;
  }
  if (line2.size() >= 2) {
    m = ((double)vec[line2[0]] - vec[line2[1]]) / ((double)line2[0] - line2[1]);
    if (m == k3) {
      d = vec[line2[0]] - m * (line2[0] + 1);
      s = 0;
      for (int i = 2; i < line2.size(); i++) {
        if (vec[line2[i]] != m * (line2[i] + 1) + d) s = 1;
      }
    }
    if (s == 0) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
  return 0;
}
