#include<bits/stdc++.h>
using namespace std;
const int N = 100010;
int f[N];
int cnt[2100000];
int main()
{
int n,m,x;
scanf("%d%d%d",&n,&m,&x);
for(int i = 1 ; i <= n ; i++)
{
int num;
scanf("%d",&num);
int t = num^x;
f[i] = max(f[i-1],cnt[t]);
cnt[num] = i;
}
while(m--)
{
int l,r;
scanf("%d%d",&l,&r);
if(f[r]>=l) puts("yes");
else puts("no");
}
return 0;
}