#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int ts, kk = 1;
int n, a[1005];
pair<int, int> q[4];
int main() {
  int t, i, j, k;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  int m1, m2, m3, m4;
  for (i = 0; i < n - 1; i++) {
    m1 = a[i];
    m2 = a[i + 1];
    if (m1 > m2) swap(m1, m2);
    for (j = 0; j < n - 1; j++) {
      if (i + 1 < j || j + 1 < i) {
        m3 = a[j];
        m4 = a[j + 1];
        if (m3 > m4) swap(m3, m4);
        if (m2 < m3 || m4 < m1 || (m1 < m3 && m4 < m2) || (m3 < m1 && m2 < m4))
          ;
        else {
          printf("yes\n");
          return 0;
        }
      }
    }
  }
  printf("no\n");
  return 0;
}
