#include<bits/stdc++.h>
using namespace std;
int n,jl,a[1005][1005],jll,jjl,sh[100005];
void dg(int x,int y,int dep){
if(x==1&&y==0&&dep>1){
sh[jjl]=1;
return ;
}else if(y>=1){
for(int j=1;j<=n;j++){
if(a[x][j]==1){
dg(j,y-1,dep+1);
}
}
}else if(y==1){
if(a[1][x]==1){
jll=1;
sh[jjl]=1;
}
if(jll==0){
sh[jjl]=0;
return ;
}else {
jll=0;
return ;
}
}
}
int main() {
int m,q,x,y;
cin>>n>>m>>q;
for(int i=1;i<=m;i++){
cin>>x>>y;
a[x][y]=1;
a[y][x]=1;
}
for(int i=1;i<=q;i++){
cin>>x>>y;
if(x==1&&y==1){
sh[jjl]=0;
jjl++;
continue;
}
dg(x,y,1);
jjl++;
}
for(int i=0;i<q;i++){
if(sh[i]==1){
cout<<"Yes"<<endl;
}else cout<<"No"<<endl;
}
return 0;
}