#include <bits/stdc++.h>
using namespace std;
vector<int> tab;
static int N;
struct Fraction {
  long long a, b;
};
Fraction b(int pA, int pB) { return Fraction{pB - pA, tab[pB] - tab[pA]}; }
bool operator==(Fraction f1, Fraction f2) {
  return (f1.a * f2.b == f1.b * f2.a);
}
bool tryWithCoeff(Fraction coeff) {
  vector<int> toProcess;
  for (int i = 2; i <= N; ++i) {
    if (!(coeff == Fraction{i - 1, tab[i] - tab[1]})) {
      toProcess.push_back(i);
    }
  }
  if (toProcess.empty()) {
    return false;
  }
  int d = toProcess.front();
  for (auto it = toProcess.begin(); it != toProcess.end(); ++it) {
    int i = *it;
    if (i == d) {
      continue;
    }
    if (!(coeff == Fraction{i - d, tab[i] - tab[d]})) {
      return false;
    }
  }
  return true;
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  tab.resize(N + 1);
  for (int i = 1; i <= N; ++i) {
    cin >> tab[i];
  }
  int ans =
      tryWithCoeff(b(1, 2)) + tryWithCoeff(b(1, 3)) + tryWithCoeff(b(2, 3));
  if (ans >= 1) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
