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++) {
            boolean found = false;
            //kontrola z lava
            if (prices[i] == 1 || prices[i] == houses) {
                found = true;
                System.out.print("NO");
            }
            int limit = Math.min((prices[i] - 1), houses - prices[i]) * 2;
            int leftLimit = Math.max(0, i - limit);
            int rightLimit = Math.min(houses - 1, i + limit);
            int counterA = 0;
            if (!found) {
                for (int j = i - 1; j >= leftLimit; j--) {
                    if (prices[j] < prices[i]) {
                        counterA--;
                    } else {
                        counterA++;
                    }
                    if (counterA == 0) {
                        System.out.print("YES");
                        found = true;
                        break;
                    }
                }
            }
            //kontrola z prava
            if (!found) {
                int counterB = 0;
                for (int j = i + 1; j <= rightLimit; j++) {
                    if (prices[j] < prices[i]) {
                        counterB--;
                    } else {
                        counterB++;
                    }
                    if (counterB == 0 || counterA * counterB < 0) {
                        System.out.print("YES");
                        found = true;
                        break;
                    }
                }
            }
            if (!found) {
                System.out.print("NO");
            }
            if (i != prices.length - 1) {
                System.out.print(" ");
            }
        }
    }
}