# 2020 SEERC

# AND = OR

Let’s call an array of integers [`b`

, _{1}`b`

, ..., _{2}`b`

] good, if we can partition all of its elements into _{m}**2** nonempty groups, such that the bitwise AND of the elements in the first group is equal to the bitwise OR of the elements in the second group. For example, the array [**1**, **7**, **3**, **11**] is good, as we can partition it into [**1**, **3**] and [**7**, **11**], where **1** OR **3** = **3** and **7** AND **11** = **3**.

You are given an array [`a`

, _{1}`a`

, ..., _{2}`a`

], and have to answer _{n}**q** queries of form: is subarray [`a`

, _{l}`a`

, ..., _{l+1}`a`

] good?_{r}

#### Input

The first line contains two integer **n**, **q** (**1** ≤ **n** ≤ `10`

, ^{5}**1** ≤ **q** ≤ `10`

) - the length of the array and the number of the associated queries.^{5}

The second line contains **n** integers `a`

, _{1}`a`

, ..., _{2}`a`

(_{n}**0** ≤ `a`

≤ _{i}`2`

- ^{30}**1**) - the elements of the array.

The **i**-th of the next **q** lines contains **2** integers `l`

, _{i}`r`

(_{i}**1** ≤ `l`

≤ _{i}`r`

≤ _{i}**n**), describing the **i**-th query.

#### Output

For each query, output **YES**, if the correspondent subarray is good, and **NO**, if it’s not.

5 15 0 1 1 3 2 1 1 1 2 1 3 1 4 1 5 2 2 2 3 2 4 2 5 3 3 3 4 3 5 4 4 4 5 5 5

NO NO YES YES YES NO YES YES YES NO NO YES NO NO NO