#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int arr[1009];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  int x1, y1, x2, y2;
  for (int i = 0; i < n - 1; i++) {
    x1 = min(arr[i], arr[i + 1]);
    y1 = max(arr[i], arr[i + 1]);
    for (int j = i + 1; j < n - 1; j++) {
      x2 = min(arr[j], arr[j + 1]);
      y2 = max(arr[j], arr[j + 1]);
      if ((x1 < x2 && y1 > x2 && y2 > y1) || (x2 < x1 && y2 > x1 && y1 > y2)) {
        printf("yes\n");
        return 0;
      }
    }
  }
  printf("no\n");
  return 0;
}
