void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  import std.typecons;

  int n; rd(n);
  auto y=readln.split.to!(long[]);

  alias pt=Tuple!(long, "x", long ,"y");
  pt[] f(long dy, long dx){
    pt[] rt;
    foreach(x; 1..n){
      long dy_=y[x]-y[0];
      if(dy*x!=dy_*dx) rt~=pt(x, y[x]);
    }
    return rt;
  }

  bool g(long _dy, long _dx, pt[] ys){
    if(ys.length==0) return false;
    if(ys.length==1) return true;
    long dy=ys[1].y-ys[0].y;
    long dx=ys[1].x-ys[0].x;
    if(_dy*dx!=dy*_dx) return false;
    foreach(i; 1..ys.length){
      long dy_=ys[i].y-ys[0].y;
      long dx_=ys[i].x-ys[0].x;
      if(dy*dx_!=dy_*dx) return false;
    }
    return true;
  }

  foreach(x; 1..n){
    long dy=y[x]-y[0];
    // int dx=x;
    auto rs=f(dy, x);
    // writeln(x, " ", rs);

    if(g(dy, x, rs)){
      writeln("Yes");
      return;
    }
  }

  // l1={1}, l2={2, 3, ..., n};
  long dydy=y[2]-y[1];
  // int dxdx=2-1;
  pt[] rsrs;
  foreach(x; 2..y.length){
    long dy_dy=y[x]-y[1];
    if(dydy*(x-1)!=dy_dy*1) rsrs~=pt(x, y[x]);
  }
  if(rsrs.length==0){
    if(y[1]-y[0]!=dydy){
      writeln("Yes"); return;
    }
  }

  writeln("No");
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}