#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, x, y;
  vector<pair<int, int>> pa;
  vector<int> num;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> x;
    num.push_back(x);
    if (i > 0) {
      y = num[i - 1];
      pa.push_back(make_pair(min(x, y), max(x, y)));
    }
  }
  for (int i = 0; i < pa.size(); i++)
    for (int j = 0; j < pa.size(); j++) {
      if (i == j) continue;
      pair<int, int> pa1 = pa[i];
      pair<int, int> pa2 = pa[j];
      if (pa1.first < pa2.first && pa1.second < pa2.second &&
          pa1.first > pa2.second) {
        cout << "yes\n";
        return 0;
      }
      if (pa1.first > pa2.first && pa1.second > pa2.second &&
          pa1.first < pa2.second) {
        cout << "yes\n";
        return 0;
      }
    }
  cout << "no\n";
}
