#include <bits/stdc++.h>
int main() {
  int j, n, x[2000], i, p = 0, q = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
  }
  for (i = 1; i < n; i++) {
    p = q = 0;
    for (j = i + 2; j <= n; j++) {
      if ((x[j] > x[i] && x[j] > x[i + 1]) || (x[j] < x[i + 1] && x[j] < x[i]))
        p++;
      else
        q++;
    }
    if (p != 0 && q != 0) break;
  }
  if (p != 0 && q != 0) {
    printf("yes\n");
  } else
    printf("no\n");
  return 0;
}
