#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  string res = "no";
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < n - 1; j++) {
      if (i != j) {
        int x1 = min(a[i], a[i + 1]);
        int x2 = max(a[i], a[i + 1]);
        int x3 = min(a[j], a[j + 1]);
        int x4 = max(a[j], a[j + 1]);
        if (x1 < x3 && x3 < x2 && x2 < x4) {
          res = "yes";
          break;
        } else if (x3 < x1 && x1 < x4 && x4 < x2) {
          res = "yes";
          break;
        }
      }
    }
    if (res == "yes") break;
  }
  cout << res;
  return 0;
}
