#include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
struct kruskal
{
int a;
int b;
};
const int MAXX = 100000;
int father[MAXX];
int unionsearch(int x)
{
return x==father[x]?x:unionsearch(father[x]);
}
int main()
{
kruskal edge[MAXX];
memset(edge,0,sizeof(kruskal));
int n,l,v;
cin>>l>>n>>v;
for(int i =1; i<=l; i++)
{
father[i] = i;
}
for(int i =1; i<=n; i++)
{
cin>>edge[i].a>>edge[i].b;
}
for(int i =1; i<=n; i++)
{
int fa = unionsearch(edge[i].a);
int fb = unionsearch(edge[i].b);
if(fa !=fb)
{
father[fb] = fa;
}
}
for(int i =1; i<=v; i++)
{
int a,b;cin>>a>>b;
int fa = unionsearch(a);
int fb = unionsearch(b);
if(fa==fb)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
return 0;
}