#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  long *Coordinates;
  Coordinates = (long *)malloc((n + 1) * sizeof(int));
  int i;
  for (i = 0; i < n; i++) {
    scanf("%ld", &Coordinates[i]);
  }
  int num = n;
  long *x, *y;
  x = (long *)malloc(num * sizeof(int));
  y = (long *)malloc(num * sizeof(int));
  int temp;
  for (i = 0; i < n - 1; i++) {
    x[i] = Coordinates[i];
    y[i] = Coordinates[i + 1];
  }
  for (i = 1; i < n - 1; ++i) {
    temp = i;
    while (temp >= 0) {
      if ((Coordinates[i] > x[temp] && Coordinates[i] < y[temp]) ||
          (Coordinates[i] < x[temp] && Coordinates[i] > y[temp])) {
        if (x[temp] < y[temp]) {
          if (Coordinates[i + 1] < x[temp] || Coordinates[i + 1] > y[temp]) {
            printf("yes");
            return 0;
          }
        } else {
          if (Coordinates[i + 1] > x[temp] || Coordinates[i + 1] < y[temp]) {
            printf("yes");
            return 0;
          }
        }
      } else if ((Coordinates[i + 1] > x[temp] &&
                  Coordinates[i + 1] < y[temp]) ||
                 (Coordinates[i + 1] < x[temp] &&
                  Coordinates[i + 1] > y[temp])) {
        if (x[temp] < y[temp]) {
          if (Coordinates[i] < x[temp] || Coordinates[i] > y[temp]) {
            printf("yes");
            return 0;
          }
        } else {
          if (Coordinates[i] > x[temp] || Coordinates[i] < y[temp]) {
            printf("yes");
            return 0;
          }
        }
      }
      --temp;
    }
  }
  printf("no");
  free(Coordinates);
  free(x);
  free(y);
  return 0;
}
