import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
import java.math.*;

public class Housing {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int houses = sc.nextInt();
        int[] prices = new int[houses];
        for (int i = 0; i < prices.length; i++) {
            prices[i] = sc.nextInt();
        }


        for (int i = 0; i < prices.length; i++) {
            //kontrola z lava
            ArrayList<Integer> leftList = new ArrayList<>();
            boolean found = false;
            int counter = 0;
            for (int j = i - 1; j >= 0; j--) {
                if (prices[j] < prices[i]) {
                    counter--;
                } else {
                    counter++;
                }
                if (counter == 0) {
                    System.out.print("YES");
                    found = true;
                    break;
                }
                leftList.add(counter);
            }
            //kontrola z prava
            ArrayList<Integer> rightList = new ArrayList<>();
            if (!found) {
                counter = 0;
                for (int j = i + 1; j < houses; j++) {
                    if (prices[j] < prices[i]) {
                        counter--;
                    } else {
                        counter++;
                    }
                    if (counter == 0) {
                        System.out.print("YES");
                        found = true;
                        break;
                    }
                    rightList.add(counter);
                }
            }
            //porovnavanie
            if (!found) {
                for (Integer number : leftList) {
                    if (rightList.contains(number * -1)) {
                        found = true;
                        System.out.print("YES");
                        break;
                    }
                }
                if (!found) {
                    System.out.print("NO");
                }
            }
            if (i != prices.length - 1) {
                System.out.print(" ");
            }
        }
    }
}