#include <bits/stdc++.h>
using namespace std;
int a[1111];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i < n; i++)
    for (int j = i + 2; j < n; j++) {
      int x1 = a[i], y1 = a[i + 1], x2 = a[j], y2 = a[j + 1];
      if (x1 > y1) swap(x1, y1);
      if (x2 > y2) swap(x2, y2);
      if (x2 > x1 && x2 < y1 && (y2 < x1 || y2 > y1)) {
        cout << "yes";
        return 0;
      }
      if (y2 > x1 && y2 < y1 && (x2 < x1 || x2 > y1)) {
        cout << "yes";
        return 0;
      }
    }
  cout << "no";
  cin >> n;
  return 0;
}
