#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
void bs_b8a() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long mod = 1e9 + 7;
long long arr[N];
using namespace std;
int main() {
  bs_b8a();
  long long ta = 1;
  while (ta--) {
    long long n;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> arr[i];
    for (int i = 0; i < n - 1; ++i) {
      for (int j = 0; j < n - 1; ++j) {
        long long x1, x2, y1, y2;
        x1 = min(arr[i], arr[i + 1]);
        y1 = max(arr[i], arr[i + 1]);
        x2 = min(arr[j], arr[j + 1]);
        y2 = max(arr[j], arr[j + 1]);
        if ((x1 < x2 && x2 < y1 && y1 < y2) ||
            (x1 > x2 && y2 < y1 && x1 < y2)) {
          cout << "yes\n";
          return 0;
        }
      }
    }
    cout << "no\n";
    return 0;
  }
}
