#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  int n, input;
  bool intersect;
  std::vector<int> arr;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    std::cin >> input;
    arr.push_back(input);
  }
  intersect = false;
  for (int i = 0; i < n - 2; ++i) {
    for (int j = i + 2; j < n - 1; ++j) {
      int A = std::min(arr[i], arr[i + 1]);
      int B = std::max(arr[i], arr[i + 1]);
      int C = std::min(arr[j], arr[j + 1]);
      int D = std::max(arr[j], arr[j + 1]);
      if (A < C && C < B && B < D) intersect = true;
      if (C < A && A < D && D < B) intersect = true;
    }
  }
  if (intersect == true)
    std::cout << "yes"
              << "\n";
  else
    std::cout << "no"
              << "\n";
  return 0;
}
