#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[1015];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int intersec = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 1; j < n && abs(i - j) > 1; j++) {
      int A = min(a[i], a[i + 1]), B = max(a[i], a[i + 1]);
      int C = min(a[j], a[j + 1]), D = max(a[j], a[j + 1]);
      if (A < C && C < B && B < D) intersec = 1;
      if (C < A && A < D && D < B) intersec = 1;
    }
  }
  cout << ((intersec == 1) ? "yes" : "no") << endl;
  return 0;
}
