import java.util.Scanner; /* 7 5 1 2 3 2 4 -1 -1 1 2 3 4 1 7 1 1 6 7 */ public class Milkyway { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int q = sc.nextInt(); int[] inputs = new int[n+1]; for (int i = 1; i <= n; i++) { inputs[i] = sc.nextInt(); } int[] descends = new int[n+1]; int descendingSoFar = 0; int last = Integer.MAX_VALUE; for (int i = n; i >= 1; i--) { if(inputs[i]<=last) { descendingSoFar++; } else { descendingSoFar = 1; } descends[i] = descendingSoFar; last = inputs[i]; } for (int i = 0; i < q; i++) { int l = sc.nextInt(); int r = sc.nextInt(); if (descends[l] >= r - l+1) { System.out.println("YES"); } else { System.out.println("NO"); } } } }