#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 77;
const double EPS = 1e-9;
const int MOD = 1000007;
const int INF = 0x7fffffff;
template <class Int>
inline int size(const Int &a) {
  return (int)a.size();
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int> > ans;
  vector<int> seq(n);
  for (__typeof(n) i = 0; i < (n); i++) cin >> seq[i];
  for (__typeof(n - 1) i = 0; i < (n - 1); i++) {
    ans.push_back(make_pair(min(seq[i], seq[i + 1]), max(seq[i], seq[i + 1])));
  }
  sort(seq.begin(), seq.end());
  for (__typeof(0) i = (0); i < (size(ans)); i++) {
    for (__typeof(0) j = (0); j < (size(ans)); j++)
      if (i == j)
        continue;
      else if ((ans[i].first < ans[j].first && ans[i].second > ans[j].first &&
                ans[i].second < ans[j].second)) {
        cout << "yes" << endl;
        return 0;
      }
  }
  cout << "no" << endl;
}
