#include<bits/stdc++.h>usingnamespace std;#defineMAXN100100int n =0;int m =0;int q =0;int parent[MAXN]={0};voidinit(){for(int i =1; i <= n; i++){
parent[i]= i;}}intfindRoot(int x){if(x == parent[x]){return x;}return parent[x]=findRoot(parent[x]);}voidunionVertices(int x,int y){
parent[findRoot(x)]=findRoot(y);}intmain(){scanf("%d%d%d",&n,&m,&q);// n 个点 m 个关系 q 次询问 init();for(int i =1; i <= m; i++){int x, y;scanf("%d%d",&x,&y);unionVertices(x,y);}for(int i =1; i <= q; i++){int x, y;scanf("%d%d",&x,&y);if(findRoot(x)==findRoot(y)){printf("Yes\n");}else{printf("No\n");}}return0;}