#include<iostream>
#include<unordered_map>
using namespace std;
const int N = 100010;
unordered_map<int,int> hashmap;
unordered_map<int,int> idx;
int main()
{
int n,m,x;
scanf("%d%d%d",&n,&m,&x);
for(int i=1;i<=n;i++)
{
int t;
scanf("%d",&t);
hashmap[i]=max(hashmap[i-1],idx[x^t]);
idx[t]=i;
}
while(m--)
{
int l,r;
scanf("%d%d",&l,&r);
if(hashmap[r]>=l) puts("yes");
else puts("no");
}
return 0;
}