#include <bits/stdc++.h>
using namespace std;
const int M = 1000 + 5;
long long int a[M];
int g[M];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  bool ok = true;
  for (long long int i = 4; i <= n; i++) {
    long long int dx1 = i - 2;
    long long int dy1 = a[i] - a[2];
    long long int dx2 = 3 - 2;
    long long int dy2 = a[3] - a[2];
    if (dy1 * dx2 != dx1 * dy2) {
      ok = false;
      break;
    }
  }
  if (ok == true) {
    long long int dx1 = 2 - 1;
    long long int dy1 = a[2] - a[1];
    long long int dx2 = 3 - 2;
    long long int dy2 = a[3] - a[2];
    if (dy1 * dx2 != dy2 * dx1) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    bool ans = false;
    g[1] = 1;
    for (int i = 2; i <= n && ans == false; i++) {
      long long int dx1 = i - 1;
      long long int dy1 = a[i] - a[1];
      vector<int> tmp;
      for (int j = 2; j <= n; j++) {
        g[j] = 0;
      }
      g[i] = 1;
      for (int j = 2; j <= n; j++) {
        if (j != i) {
          long long int dx2 = j - 1;
          long long int dy2 = a[j] - a[1];
          if (dy1 * dx2 == dy2 * dx1) {
            g[j] = 1;
          } else {
            tmp.push_back(j);
          }
        }
      }
      int len = tmp.size();
      if (len == 0) {
        ans = false;
      } else {
        if (len == 1) {
          ans = true;
          break;
        } else {
          bool fok = true;
          long long int fx1 = tmp[1] - tmp[0];
          long long int fy1 = a[tmp[1]] - a[tmp[0]];
          for (int k = 2; k < len; k++) {
            long long int fx2 = tmp[k] - tmp[0];
            long long int fy2 = a[tmp[k]] - a[tmp[0]];
            if (fy2 * fx1 != fy1 * fx2) {
              fok = false;
              break;
            }
          }
          if (fok == false) {
            ans = false;
          } else {
            if (fy1 * dx1 == fx1 * dy1) {
              ans = true;
              break;
            } else {
              ans = false;
            }
          }
        }
      }
    }
    if (ans == true) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
