#include <bits/stdc++.h>
using namespace std;
struct unit {
  long long int a[1000000];
};
long long fact(long long int x) {
  if (x == 1 || x == 0)
    return 1;
  else
    return x * fact(x - 1);
}
long long power(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return power(x * x, n / 2);
  else
    return x * power(x * x, (n - 1) / 2);
}
int main() {
  cin.tie(0), cin.sync_with_stdio(0), cout.tie(0), cout.sync_with_stdio(0);
  long long i, j, k, l, m, n, a = 0, cnt = 0, x;
  cin >> n;
  vector<long long int> v;
  for (i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n - 1; j++) {
      k = max(v[i], v[i + 1]);
      l = min(v[i], v[i + 1]);
      m = max(v[j], v[j + 1]);
      a = min(v[j], v[j + 1]);
      if ((k > a && a > l && m > k) || (a < l && m > l && m < k)) {
        cnt = 1;
        cout << "yes";
        break;
      }
    }
    if (cnt == 1) break;
  }
  if (cnt == 0) cout << "no";
}
