#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int t[1003];
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  for (int i = 1; i < n - 1; i++) {
    for (int j = i; j < n - 1; j++) {
      int x = min(t[j], t[j + 1]), y = max(t[j], t[j + 1]);
      int a = min(t[i - 1], t[i]), b = max(t[i - 1], t[i]);
      if ((x < b and a < x and b < y) or (x < a and a < y and y < b)) {
        cout << "yes";
        return 0;
      }
    }
  }
  cout << "no";
}
