#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int l = INT_MAX;
  int h = INT_MIN;
  string ans = "no";
  if (n > 3) {
    vector<pair<int, int>> arr;
    int a, b;
    cin >> a >> b;
    if (a < b)
      arr.push_back({a, b});
    else
      arr.push_back({b, a});
    for (int i = 3; i <= n; i++) {
      int c;
      cin >> c;
      if (b < c)
        arr.push_back({b, c});
      else
        arr.push_back({c, b});
      b = c;
    }
    for (int i = 0; i < (int)arr.size(); i++) {
      for (int j = i + 1; j < (int)arr.size(); j++) {
        pair<int, int> f = arr[i];
        pair<int, int> s = arr[j];
        if ((f.first < s.first && f.second > s.first && f.second < s.second) ||
            (f.first > s.first && f.first < s.second && f.second > s.second)) {
          ans = "yes";
          break;
        }
      }
    }
  }
  cout << ans << endl;
}
