#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int main() {
  int n, i, x = 0, y = 0, j;
  int a[1000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    x = y = 0;
    for (j = i + 2; j < n; j++) {
      if ((a[j] > a[i] && a[j] > a[i + 1]) || (a[j] < a[i] && a[j] < a[i + 1]))
        x++;
      else
        y++;
    }
    if (x && y) {
      printf("yes\n");
      return 0;
    }
  }
  printf("no\n");
  return 0;
}
