#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const string nl = "\n";
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (auto& i : a) {
    cin >> i;
  }
  auto check = [&](double k) -> bool {
    set<double> se;
    for (long long i = 0; i < n; ++i) {
      se.insert(a[i] - k * i);
    }
    return ((long long)(se).size()) == 2;
  };
  if (check(a[1] - a[0]) || check(a[2] - a[1]) || check((a[2] - a[0]) / 2.0)) {
    cout << "Yes" << nl;
  } else {
    cout << "No" << nl;
  }
}
