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.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedInputStream;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.FilterInputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jenish
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CLadder solver = new CLadder();
        solver.solve(1, in, out);
        out.close();
    }

    static class CLadder {
        int[] arr;
        SegLazy inc;
        SegLazy dec;

        public void solve(int testNumber, ScanReader in, PrintWriter out) {

            int n = in.scanInt();
            int m = in.scanInt();


            arr = new int[n];
            for (int i = 0; i < n; i++) arr[i] = in.scanInt();

            inc = new SegLazy(n);
            for (int i = 1; i < n; i++) if (arr[i] >= arr[i - 1]) inc.update(i, i, 1);


            dec = new SegLazy(n);
            for (int i = 1; i < n; i++) if (arr[i] <= arr[i - 1]) dec.update(i, i, 1);


            MaxSeg maxSeg = new MaxSeg(n);
            for (int i = 0; i < n; i++) maxSeg.setMax(i, arr[i]);
            HashMap<Integer, ArrayList<Integer>> hm = new HashMap<>();
            for (int k : arr) hm.put(k, new ArrayList<>());
            for (int i = 0; i < n; i++) hm.get(arr[i]).add(i);


            while (m-- > 0) {
                int l = in.scanInt() - 1;
                int r = in.scanInt() - 1;


                int max = (int) maxSeg.max(l, r);
                int index = -1;
                int ll = 0;
                int hh = hm.get(max).size() - 1;
                while (ll <= hh) {
                    int mid = (ll + hh) / 2;
                    if (hm.get(max).get(mid) >= l) {
                        index = mid;
                        hh = mid - 1;
                    } else {
                        ll = mid + 1;
                    }
                }


                index = hm.get(max).get(index);
                if (index >= l && index <= r && arr[index] == max) {

                    if (isincreament(l, index) && isde(index + 1, r)) {
                        out.println("Yes");
                    } else {
                        out.println("No");
                    }
                } else {
                    throw new RuntimeException("ERERe ");
                }


            }
        }

        boolean isincreament(int l, int r) {
            if (l > r) return true;
            if (l == r) return true;
            return (r - (l + 1) + 1 == inc.getSum(l + 1, r));
        }

        boolean isde(int l, int r) {
            if (l > r) return true;
            if (l == r) return true;
            return (r - (l + 1) + 1 == dec.getSum(l + 1, r));
        }

    }

    static class MaxSeg {
        long[] tree;
        int n;

        public MaxSeg(int n) {
            this.n = n;
            tree = new long[2 * n];
            Arrays.fill(tree, Integer.MIN_VALUE);
        }

        public void setMax(int i, long value) {
            i += this.tree.length / 2;
            this.tree[i] = value;
            for (; i > 1; i >>= 1)
                this.tree[i >> 1] = Math.max(this.tree[i], this.tree[i ^ 1]);
        }

        public long max(int a, int b) {
            long res = Long.MIN_VALUE;
            for (a += this.tree.length / 2, b += this.tree.length / 2; a <= b; a = (a + 1) >> 1, b = (b - 1) >> 1) {
                res = Math.max(res, this.tree[a]);
                res = Math.max(res, this.tree[b]);
            }
            return res;
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        public int scanInt() {
            int I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }

    static class SegLazy {
        int n;
        long[] tree;
        long[] lazy;

        public SegLazy(int n) {
            this.n = n;
            this.tree = new long[(4 * n) + 5];
            this.lazy = new long[(4 * n) + 5];
        }

        public void update(int l, int r, long val) {
            update(1, 0, n - 1, l, r, val);
        }

        public long getSum(int l, int r) {
            return queryRange(1, 0, n - 1, l, r);
        }

        private void update(int node, int start, int end, int l, int r, long val) {
            LAZY(node, start, end);
            if (start > end || start > r || end < l) return;
            if (start >= l && end <= r) {
                tree[node] += (end - start + 1) * val;
                if (start != end) {
                    lazy[node * 2] += val;
                    lazy[(node * 2) + 1] += val;
                }
                return;
            }
            int mid = (start + end) / 2;
            update(node * 2, start, mid, l, r, val);
            update((node * 2) + 1, mid + 1, end, l, r, val);
            tree[node] = tree[node * 2] + tree[(node * 2) + 1];
        }

        private void LAZY(int node, int start, int end) {
            if (lazy[node] != 0) {
                tree[node] += (end - start + 1) * lazy[node];
                if (start != end) {
                    lazy[node * 2] += lazy[node];
                    lazy[(node * 2) + 1] += lazy[node];
                }
                lazy[node] = 0;
            }
        }

        private long queryRange(int node, int start, int end, int l, int r) {
            if (start > end || start > r || end < l) return 0;
            LAZY(node, start, end);
            if (start >= l && end <= r) return (tree[node]);
            int mid = (start + end) / 2;
            long p1 = queryRange(node * 2, start, mid, l, r);
            long p2 = queryRange((node * 2) + 1, mid + 1, end, l, r);
            return ((p1 + p2));
        }

    }
}

