#include <bits/stdc++.h>
using namespace std;
int n;
int x[1005];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 0; i < n - 1; ++i) {
    int i1 = (i + 1) % n;
    int x1 = min(x[i], x[i1]), x2 = max(x[i], x[i1]);
    for (int j = 0; j < n - 1; ++j) {
      if (i == j) continue;
      int y1 = min(x[j], x[(j + 1) % n]), y2 = max(x[j], x[(j + 1) % n]);
      if (x1 >= y1 && x2 <= y2 || x1 <= y1 && x2 >= y2) continue;
      if (min(x2, y2) > max(x1, y1)) {
        cout << "yes\n";
        return 0;
      }
    }
  }
  cout << "no\n";
  return 0;
}
