#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 1;
const int M = 1e9;
int n;
long long a[N];
bool f(double k) {
  set<double> s;
  for (int i = (1); i <= (n); i++) s.insert(a[i] - k * i);
  return s.size() == 2;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = (1); i <= (n); i++) cin >> a[i];
  if (f(a[2] - a[1]) || f(a[3] - a[2]) || f((a[3] - a[1]) / 2.0))
    cout << "Yes\n";
  else
    cout << "No\n";
}
