#include <bits/stdc++.h>
struct Point {
  int x;
  int y;
  int setFor;
};
int n;
Point points[1010];
struct Line {
  Point p1, p2;
};
Line line1, line2;
inline void initPoints(int d) {
  for (int i = 0; i < n; i++) points[i].setFor = -1;
}
void checkForLine(Line &line, int d) {
  for (int i = 0; i < n; i++) {
    int y = (points[i].y - line.p1.y) * (line.p2.x - line.p1.x);
    int x = (points[i].x - line.p1.x) * (line.p2.y - line.p1.y);
    if (y == x) points[i].setFor = d;
  }
}
int findLine(Line &line, int d) {
  int first = -1;
  int second = -1;
  for (int i = 0; i < n; i++) {
    if (points[i].setFor == -1) {
      if (first == -1) {
        first = i;
      } else {
        if (second == -1) second = i;
      }
    }
  }
  if (first == -1) return -1;
  if (second == -1) return 1;
  points[first].setFor = d;
  line.p1 = points[first];
  points[second].setFor = d;
  line.p2 = points[second];
  checkForLine(line, d);
  return 0;
}
bool isLeft() {
  for (int i = 0; i < n; i++)
    if (points[i].setFor == -1) return true;
  return false;
}
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
int mult(Point a, Point b, Point c) {
  return (a.x - c.x) * (b.y - c.y) - (b.x - c.x) * (a.y - c.y);
}
bool isParr(Line &l1, Line &l2) {
  int dx1 = l1.p2.x - l1.p1.x;
  int dy1 = l1.p2.y - l1.p1.y;
  int dx2 = l2.p2.x - l2.p1.x;
  int dy2 = l2.p2.y - l2.p1.y;
  if (dx1 == 0 && dx2 == 0) {
    if (dy1 != dy2)
      return true;
    else
      return false;
  }
  if (dy2 * dx1 == dy1 * dx2)
    return true;
  else
    return false;
}
bool doCheck(int pa, int pb) {
  initPoints(-1);
  points[pa].setFor = 0;
  line1.p1 = points[pa];
  points[pb].setFor = 0;
  line1.p2 = points[pb];
  checkForLine(line1, 0);
  int res = findLine(line2, 1);
  if (res == 1) {
    return true;
  }
  if (res == 0) {
    if (isLeft() == false) {
      if (isParr(line1, line2)) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    points[i].setFor = -1;
    points[i].x = i + 1;
    scanf("%d", &(points[i].y));
  }
  if (doCheck(0, 1)) {
    printf("Yes\n");
    return 0;
  }
  if (doCheck(0, 2)) {
    printf("Yes\n");
    return 0;
  }
  if (doCheck(1, 2)) {
    printf("Yes\n");
    return 0;
  }
  printf("No\n");
  return 0;
}
