#include <bits/stdc++.h>
int main() {
  int n;
  double in[1001];
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &in[i]);
  double increase = in[2] - in[1];
  double increase2 = in[3] - in[2];
  double increase3 = (in[3] - in[1]) / 2;
  if (increase == increase2) {
    double y = in[1] - increase;
    double y2;
    bool find = false;
    if (n == 3)
      printf("No");
    else {
      for (int i = 4; i <= n; i++) {
        if (y + increase * i != in[i]) {
          find = true;
          y2 = in[i] - i * increase;
          break;
        }
      }
      if (find == false)
        printf("No");
      else {
        bool ans = true;
        for (int i = 1; i <= n; i++)
          if (in[i] != y + i * increase && in[i] != y2 + i * increase)
            ans = false;
        if (ans)
          printf("Yes");
        else
          printf("No");
      }
    }
  } else {
    if (n == 3)
      printf("Yes");
    else {
      double y = in[1] - increase;
      double y2 = in[3] - 3 * increase;
      bool ans = true;
      for (int i = 1; i <= n; i++)
        if (in[i] != y + i * increase && in[i] != y2 + i * increase)
          ans = false;
      if (ans) {
        printf("Yes");
        return 0;
      }
      y = in[2] - 2 * increase2;
      y2 = in[1] - increase2;
      ans = true;
      for (int i = 1; i <= n; i++)
        if (in[i] != y + i * increase2 && in[i] != y2 + i * increase2)
          ans = false;
      if (ans) {
        printf("Yes");
        return 0;
      }
      y = in[1] - increase3;
      y2 = in[2] - 2 * increase3;
      ans = true;
      for (int i = 1; i <= n; i++)
        if (in[i] != y + i * increase3 && in[i] != y2 + i * increase3)
          ans = false;
      if (ans) {
        printf("Yes");
        return 0;
      } else {
        printf("No");
        return 0;
      }
    }
  }
  return 0;
}
