#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const long long mod = 1000000007;
const int N = 201000;
int n, y[N];
double k;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &y[i]);
  int b = -1;
  for (int i = 2; i < n; ++i)
    if ((long long)(y[i] - y[0]) * (i - 1) != (long long)(y[i] - y[1]) * i) {
      b = i;
      break;
    }
  if (~b) {
    bool ans = 0, tans = 1;
    for (int i = 2; i < n; ++i)
      if (i != b) {
        bool t =
            (long long)(y[i] - y[0]) * (i - 1) != (long long)(y[i] - y[1]) * i;
        bool s = (long long)(y[i] - y[b]) != (long long)(y[1] - y[0]) * (i - b);
        if (s && t) {
          tans = 0;
          break;
        }
      }
    ans |= tans;
    tans = 1;
    for (int i = 2; i < n; ++i)
      if (i != b) {
        bool t =
            (long long)(y[i] - y[0]) * (i - b) != (long long)(y[i] - y[b]) * i;
        bool s =
            (long long)(y[i] - y[1]) * b != (long long)(y[b] - y[0]) * (i - 1);
        if (s && t) {
          tans = 0;
          break;
        }
      }
    ans |= tans;
    tans = 1;
    for (int i = 2; i < n; ++i)
      if (i != b) {
        bool t = (long long)(y[i] - y[1]) * (i - b) !=
                 (long long)(y[i] - y[b]) * (i - 1);
        bool s =
            (long long)(y[i] - y[0]) * (b - 1) != (long long)(y[b] - y[1]) * i;
        if (s && t) {
          tans = 0;
          break;
        }
      }
    ans |= tans;
    puts(ans ? "Yes" : "No");
  } else {
    puts("No");
  }
  return 0;
}
