#include <bits/stdc++.h>
using namespace std;
const int N = 1000, geps = 10;
int n, a[N + geps];
void Init() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) scanf("%d", &a[i]);
}
void Solve() {
  Init();
  for (int i = (1); i <= (n - 1); ++i) {
    for (int j = (i + 1); j <= (n - 1); ++j) {
      int x1 = a[i], x2 = a[i + 1], x3 = a[j], x4 = a[j + 1];
      if (x1 > x2) swap(x1, x2);
      if (x3 > x4) swap(x3, x4);
      if (x1 < x3 && x3 < x2 && x2 < x4) {
        puts("yes");
        return;
      }
      if (x3 < x1 && x1 < x4 && x4 < x2) {
        puts("yes");
        return;
      }
    }
  }
  puts("no");
}
int main() {
  Solve();
  return 0;
}
