#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  cin >> num;
  vector<int> tmp(num, 0);
  for (int i = 0; i < num; ++i) {
    cin >> tmp[i];
  }
  if (num <= 2) {
    cout << "no";
    return 0;
  }
  vector<int> s;
  vector<int> e;
  for (int i = 1; i < num; ++i) {
    s.push_back(min(tmp[i - 1], tmp[i]));
    e.push_back(max(tmp[i], tmp[i - 1]));
  }
  for (int i = 0; i < s.size() - 1; ++i) {
    for (int j = i + 1; j < s.size(); ++j) {
      if ((s[i] < s[j] && s[j] < e[i] && e[i] < e[j]) ||
          (s[j] < s[i] && s[i] < e[j] && e[j] < e[i])) {
        cout << "yes";
        return 0;
      }
    }
  }
  cout << "no";
  return 0;
}
