#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, now, prev;
  vector<pair<int, int> > e;
  cin >> n >> prev;
  for (int i = 1; i < n; ++i) {
    cin >> now;
    e.push_back(pair<int, int>(min(prev, now), max(prev, now)));
    prev = now;
  }
  sort(e.begin(), e.end());
  for (unsigned i = 0; i < e.size(); ++i) {
    for (unsigned j = i + 1; j < e.size(); ++j) {
      if (e[j].first > e[i].first && e[j].first < e[i].second &&
          e[j].second > e[i].second) {
        cout << "yes\n";
        return 0;
      }
    }
  }
  cout << "no\n";
}
