#include <iostream>
using namespace std;
template < class Type >
struct
DisjointSet
{
Type father[10001];
DisjointSet( const int n )
{
for( int i = 1; i <= n; i++ )
father[i] = i;
}
DisjointSet()
{
for( int i = 1; i <= 10000; i++ )
father[i] = i;
}
Type
getFather( const Type x )
{
Type t = x;
while( father[t] != t )
t = father[t];
Type tt = x;
while( father[tt] != tt )
{
int tx = father[tt];
father[tt] = t;
tt = tx;
}
return t;
}
void
mergeElement( const Type x, const Type y )
{
Type
fx = getFather( x ), fy = getFather( y );
if( fx != fy )
father[fy] = fx;
}
bool
judgeElement( const Type x, const Type y )
{
if( getFather( x ) == getFather( y ) )
return true;
else
return false;
}
};
int
main()
{
int
n, m, o;
cin >> n >> m >> o;
DisjointSet < int > intds( n );
for( int i = 1; i <= m; i++ )
{
int x, y;
cin >> x >> y;
intds.mergeElement( x, y );
}
for( int i = 1; i <= o; i++ )
{
int x, y;
cin >> x >> y;
if( intds.judgeElement( x, y ) )
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}