You've got an array, consisting of n integers a1, a2, ..., an. Also, you've got m queries, the i-th query is described by two integers li, ri. Numbers li, ri define a subsegment of the original array, that is, the sequence of numbers ali, ali + 1, ali + 2, ..., ari. For each query you should check whether the corresponding segment is a ladder. 

A ladder is a sequence of integers b1, b2, ..., bk, such that it first doesn't decrease, then doesn't increase. In other words, there is such integer x (1 ≤ x ≤ k), that the following inequation fulfills: b1 ≤ b2 ≤ ... ≤ bx ≥ bx + 1 ≥ bx + 2... ≥ bk. Note that the non-decreasing and the non-increasing sequences are also considered ladders.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 105) — the number of array elements and the number of queries. The second line contains the sequence of integers a1, a2, ..., an (1 ≤ ai ≤ 109), where number ai stands for the i-th array element.

The following m lines contain the description of the queries. The i-th line contains the description of the i-th query, consisting of two integers li, ri (1 ≤ li ≤ ri ≤ n) — the boundaries of the subsegment of the initial array.

The numbers in the lines are separated by single spaces.

Output

Print m lines, in the i-th line print word "Yes" (without the quotes), if the subsegment that corresponds to the i-th query is the ladder, or word "No" (without the quotes) otherwise. 

Examples

Input

8 6
1 2 1 3 3 5 2 1
1 3
2 3
2 4
8 8
1 4
5 8


Output

Yes
Yes
No
Yes
No
Yes
import java.util.*;


import java.io.*;
import java.math.*;
public class A
	
	{ 
		 static FastReader sc=new FastReader(); 
		 
			  public static void main(String[] args)
	    {
				    //CHECK FOR N=1
	       	//CHECK FOR N=1
		    //CHECK FOR N=1
	       	//CHECK FOR N=1
		  
		  PrintWriter out=new PrintWriter(System.out);
		  StringBuffer sb=new StringBuffer("");
	  int ttt=1;
	    // ttt =i(); 
	 
        outer :while (ttt-- > 0) 
		{
        	int n=i();
        	int q=i();
        	int A[]=input(n);
        	int pv=0;
        	TreeMap<Integer,Integer> map=new TreeMap<Integer, Integer>();
        	int val=0;
        	for(int i=1;i<n;i++) {
        		if(A[i]==A[i-1]) {
        			if(pv==1) {
        			int j=i;
        			while(j<n && A[j]==A[j-1]) {
        				j++;
        			}
        			if(j==n) {
        				map.put(val, n-1);
        				break;
        			}
        			if(A[j]<A[j-1]) {
        				i=j;
        				continue;
        			}
        			else {
        				map.put(val, j-1);
        				val=i-1;
        				pv=0;
        				i=j;
        			}
        			continue;
        			}
        			else {
        			continue;
        			}
        		}
        		if(A[i]>A[i-1]) {
        			if(pv==0) {
        				if(i==n-1) {
        					map.put(val, n-1);
        				}
        				continue;
        			}
        			else {
        				pv=0;
        				map.put(val, i-1);
        				val=i-1;
        			}
        		}
        		else {
        			if(i==n-1) {
    					map.put(val, n-1);
    				}
        			if(pv==1)
        				continue;
        			else {
        				pv=1;
        			}
        		}
        	}
        	map.put(val, n-1);
        	
        	while(q-->0) {
        		int l=i()-1;
        		int u=i()-1;
        		
        		Integer p=map.floorKey(l);
        		if(p==null) {
        			out.println("No");
        		}
        		else {
        			int y=p;
        			int rr=map.get(y);
        			if(rr>=u) {
        				out.println("Yes");
        			}
        			else {
        				out.println("No");
        			}
        		}
        	}
        	
        	
        	
		}
	   out.close();
      // System.out.println(sb.toString());
       
       
       //CHECK FOR N=1                    //CHECK FOR M=0
        //CHECK FOR N=1                    //CHECK FOR M=0
       	//CHECK FOR N=1
       	//CHECK FOR N=1
       	//CHECK FOR N=1
    }
			  
				  
				  
  




static int[] input(int n) {
  	int A[]=new int[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.nextInt();
  	   }
  	   return A;
     }
  static long[] inputL(int n) {
  	long A[]=new long[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.nextLong();
  	   }
  	   return A;
     }
  static String[] inputS(int n) {
  	String A[]=new String[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.next();
  	   }
  	   return A;
     }
  static long sum(int A[]) {
  	long sum=0;
  	for(int i : A) {
  		sum+=i;
  	}
  	return sum;
  }
  static long sum(long A[]) {
  	long sum=0;
  	for(long i : A) {
  		sum+=i;
  	}
  	return sum;
  }

  static void input(int A[],int B[]) {
  	   for(int i=0;i<A.length;i++) {
  		   A[i]=sc.nextInt();
  		   B[i]=sc.nextInt();
  	   }
  }
  static int[][] input(int n,int m){
  	int A[][]=new int[n][m];
  	for(int i=0;i<n;i++) {
  		for(int j=0;j<m;j++) {
  			A[i][j]=i();
  		}
  	}
  	return A;
  }
  static char[][] charinput(int n,int m){
  	char A[][]=new char[n][m];
  	for(int i=0;i<n;i++) {
  		String s=s();
  		for(int j=0;j<m;j++) {
  			A[i][j]=s.charAt(j);
  		}
  	}
  	return A;
  }
  static int max(int A[]) {
  	int max=Integer.MIN_VALUE;
  	for(int i=0;i<A.length;i++) {
  		max=Math.max(max, A[i]);
  	}
  	return max;
  }
  static int min(int A[]) {
  	int min=Integer.MAX_VALUE;
  	for(int i=0;i<A.length;i++) {
  		min=Math.min(min, A[i]);
  	}
  	return min;
  }
  static long max(long A[]) {
  	long max=Long.MIN_VALUE;
  	for(int i=0;i<A.length;i++) {
  		max=Math.max(max, A[i]);
  	}
  	return max;
  }
  static long min(long A[]) {
  	long min=Long.MAX_VALUE;
  	for(int i=0;i<A.length;i++) {
  		min=Math.min(min, A[i]);
  	}
  	return min;
  }
  static long mod(long x) {
  	 int mod=1000000007;
  	  return ((x%mod + mod)%mod);
  }
  static String reverse(String s) {
  	StringBuffer p=new StringBuffer(s);
  	p.reverse();
  	return p.toString();
  }

       static int i() {
      	 return sc.nextInt();
       }
       static String s() {
      	 return sc.next();
       }
       static long l() {
      	 return sc.nextLong();
       }  
       static void sort(int[] A){
          int n = A.length;
          Random rnd = new Random();
          for(int i=0; i<n; ++i){
              int tmp = A[i];
              int randomPos = i + rnd.nextInt(n-i);
              A[i] = A[randomPos];
              A[randomPos] = tmp;
          }
          Arrays.sort(A);
       }
       static void sort(long[] A){
  	        int n = A.length;
  	        Random rnd = new Random();
  	        for(int i=0; i<n; ++i){
  	            long tmp = A[i];
  	            int randomPos = i + rnd.nextInt(n-i);
  	            A[i] = A[randomPos];
  	            A[randomPos] = tmp;
  	        }
  	        Arrays.sort(A);
  	     }
    static String sort(String s) {
   	 Character ch[]=new Character[s.length()];
   	 for(int i=0;i<s.length();i++) {
   		 ch[i]=s.charAt(i);
   	 }
   	 Arrays.sort(ch);
   	 StringBuffer st=new StringBuffer("");
 for(int i=0;i<s.length();i++) {
	 st.append(ch[i]);
 }
 return st.toString();
}
static HashMap<Integer,Integer> hash(int A[]){
  HashMap<Integer,Integer> map=new HashMap<Integer, Integer>();
  for(int i : A) {
	  if(map.containsKey(i)) {
		  map.put(i, map.get(i)+1);
	  }
	  else {
		  map.put(i, 1);
	  }
  }
  return map;
}
static HashMap<Long,Integer> hash(long A[]){
	  HashMap<Long,Integer> map=new HashMap<Long, Integer>();
	  for(long i : A) {
		  if(map.containsKey(i)) {
			  map.put(i, map.get(i)+1);
		  }
		  else {
			  map.put(i, 1);
		  }
	  }
	  return map;
	}
static TreeMap<Integer,Integer> tree(int A[]){
  TreeMap<Integer,Integer> map=new TreeMap<Integer, Integer>();
  for(int i : A) {
	  if(map.containsKey(i)) {
		  map.put(i, map.get(i)+1);
	  }
	  else {
		  map.put(i, 1);
	  }
  }
  return map;
}
static TreeMap<Long,Integer> tree(long A[]){
	  TreeMap<Long,Integer> map=new TreeMap<Long, Integer>();
	  for(long i : A) {
		  if(map.containsKey(i)) {
			  map.put(i, map.get(i)+1);
		  }
		  else {
			  map.put(i, 1);
		  }
	  }
	  return map;
	}
   static boolean prime(int n) 
    { 
        if (n <= 1) 
            return false; 
        if (n <= 3) 
            return true; 
        if (n % 2 == 0 || n % 3 == 0) 
            return false; 
        double sq=Math.sqrt(n);
  
        for (int i = 5; i <= sq; i = i + 6) 
            if (n % i == 0 || n % (i + 2) == 0) 
                return false; 
        return true; 
    } 
   static boolean prime(long n) 
    { 
        if (n <= 1) 
            return false; 
        if (n <= 3) 
            return true; 
        if (n % 2 == 0 || n % 3 == 0) 
            return false; 
        double sq=Math.sqrt(n);
  
        for (int i = 5; i <= sq; i = i + 6) 
            if (n % i == 0 || n % (i + 2) == 0) 
                return false; 
        return true; 
    } 
   static int gcd(int a, int b) 
   { 
       if (a == 0) 
           return b; 
       return gcd(b % a, a); 
   } 
   static long gcd(long a, long b) 
   { 
       if (a == 0) 
           return b; 
       return gcd(b % a, a); 
   } 
   static class Pair implements Comparable<Pair>
   {
  	 int x;
  	 int y;
  	 Pair(int x,int y){
  		 this.x=x;
  		 this.y=y;
  	 }
	@Override
	public int compareTo(Pair o) {
		if(this.x>o.x)
			return 1;
		else if(this.x<o.x)
			return -1;
		else {
			if(this.y<o.y)
				return 1;
			else if(this.y>o.y)
				return -1;
			else
				return 0;
		}
	}
   }
      
  static class FastReader 
  { 
      BufferedReader br; 
      StringTokenizer st; 

      public FastReader() 
      { 
          br = new BufferedReader(new
                   InputStreamReader(System.in)); 
      } 

      String next() 
      { 
          while (st == null || !st.hasMoreElements()) 
          { 
              try
              { 
                  st = new StringTokenizer(br.readLine()); 
              } 
              catch (IOException  e) 
              { 
                  e.printStackTrace(); 
              } 
          } 
          return st.nextToken(); 
      } 

      int nextInt() 
      { 
          return Integer.parseInt(next()); 
      } 

      long nextLong() 
      { 
          return Long.parseLong(next()); 
      } 

      double nextDouble() 
      { 
          return Double.parseDouble(next()); 
      } 

      String nextLine() 
      { 
          String str = ""; 
              try
              { 
                  str = br.readLine(); 
              } 
              catch (IOException e) 
              { 
                  e.printStackTrace(); 
              } 
              return str; 
          } 
      } 
  } 



