#include <bits/stdc++.h>
using namespace std;
int n, a[3030], lowi, highi, lowj, highj;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 2; i++) {
    lowi = min(a[i], a[i + 1]), highi = max(a[i], a[i + 1]);
    for (int j = i + 1; j < n - 1; j++) {
      int lowj = min(a[j], a[j + 1]);
      int highj = max(a[j], a[j + 1]);
      if ((lowj > lowi && lowj < highi && highj > highi) ||
          (lowj < lowi && highj > lowi && highj < highi)) {
        cout << "yes" << endl;
        return 0;
      }
    }
  }
  cout << "no" << endl;
  return 0;
}
