#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T a, T b = 0) {
  if (b == 0) return (a < 0) ? -a : a;
  return (a > b) ? (a - b) : (b - a);
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
long long xp(long long b, long long n, long long m) {
  long long r = 1;
  while (n > 0) {
    if (n & 1) {
      r = r * b;
      if (r >= m) r %= m;
    }
    n >>= 1;
    b = b * b;
    if (b >= m) b %= m;
  }
  return r % m;
}
long long inv(long long a, long long m) {
  long long m0 = m, t, q;
  long long x0 = 0, x1 = 1;
  if (m == 1) return 0;
  while (a > 1) {
    q = a / m;
    t = m;
    m = a % m, a = t;
    t = x0;
    x0 = x1 - q * x0;
    x1 = t;
  }
  if (x1 >= m) x1 %= m;
  if (x1 < 0) x1 += m0;
  return x1;
}
bool pali(string temp, int i, int j) {
  if (i >= j) return true;
  if (temp[i] == temp[j]) return pali(temp, i + 1, j - 1);
  return false;
}
template <typename F, typename S>
ostream &operator<<(ostream &os, const pair<F, S> &p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  typename vector<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ",";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << "[";
  typename set<T>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ",";
    os << *it;
  }
  return os << "]";
}
template <typename F, typename S>
ostream &operator<<(ostream &os, const map<F, S> &v) {
  os << "[";
  typename map<F, S>::const_iterator it;
  for (it = v.begin(); it != v.end(); it++) {
    if (it != v.begin()) os << ",";
    os << it->first << "=" << it->second;
  }
  return os << "]";
}
bool same(double a, double b) { return fabs(a - b) < 1e-8; }
double y[1002];
double num[1002][1002];
double getm(int i, int j) {
  double ret = y[j] - y[i];
  ret /= (j - i);
  return ret;
}
vector<int> frst, scnd;
bool check() {
  if (frst.size() == 1 && scnd.size() == 1) return 1;
  if (frst.empty() || scnd.empty()) return 0;
  int sz1 = frst.size(), sz2 = scnd.size();
  for (int i = 0; i < sz1; i++)
    for (int j = 1; j < sz2; j++)
      if (same(num[frst[i]][scnd[0]], num[frst[i]][scnd[j]])) return false;
  for (int i = 0; i < sz2; i++)
    for (int j = 1; j < sz1; j++)
      if (same(num[scnd[i]][frst[0]], num[scnd[i]][frst[j]])) return false;
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n + 1; i++) cin >> y[i];
  for (int i = 1; i < n + 1; i++)
    for (int j = i + 1; j < n + 1; j++) num[j][i] = num[i][j] = getm(i, j);
  for (int i = 1; i < n + 1; i++) num[i][i] = 0;
  for (int i = 2; i < n + 1; i++) {
    frst.clear();
    scnd.clear();
    scnd.push_back(1);
    double now = num[1][i];
    for (int j = 2; j < n + 1; j++) {
      if (!same(now, num[1][j]))
        frst.push_back(j);
      else
        scnd.push_back(j);
    }
    int sz = frst.size();
    bool hoise = true;
    for (int j = 1; j < sz; j++)
      if (!same(now, num[frst[0]][frst[j]])) {
        hoise = false;
        break;
      }
    if (hoise && check()) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  frst.clear();
  scnd.clear();
  scnd.push_back(1);
  for (int i = 2; i < n + 1; i++) frst.push_back(i);
  int sz = frst.size();
  bool hoise = true;
  for (int j = 1; j < sz; j++)
    if (!same(num[frst[0]][frst[1]], num[frst[0]][frst[j]])) {
      hoise = false;
      break;
    }
  if (hoise && check()) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
