#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mkp make_pair
#define rint register int
#define INF ((1 << 30) - 1)
#define FI(n) FastIO::read(n)
#define FO(n) FastIO::write(n)
#define Pair pair < int, int >
#define mst(a,b) memset(a,b,sizeof(a))
#define foR(i, k, j) for(rint i = (k); i >= (j); i--)
#define For(i, k, j) for(rint i = (k); i <= (j); i++)
#define Foe(i, u) for(rint i = lst[u], v = e[i].v; i; i = e[i].nxt, v = e[i].v)
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define file(s) freopen(s".in", "r", stdin); freopen(s".out", "w", stdout)
//#define int long long
const int P = 998244353; //
using namespace std;
inline void ckmax(int &a, int b) {a = max(a, b);}
inline void ckmin(int &a, int b) {a = min(a, b);}
inline void mulmod(int &a, int b) {a = 1ll * a * b % P;}
inline void addmod(int &a, int b) {int t = a + b; a = (t >= P ? t - P : t); }
inline int ksm(int a, int b) {int ans=1; for(;b;b>>=1) {if(b&1) ans=1ll*ans*a%P;a=1ll*a*a%P;}return ans;}
inline int inv(int a) {return ksm(a, P-2);}
namespace FastIO {
    const int SIZE=1<<16; char buf[SIZE], obuf[SIZE], str[64]; int bi=SIZE, bn=SIZE, opt;
    int read(char *s) {
        while (bn) {for (;bi<bn&&buf[bi]<=' ';bi++);if (bi<bn) break; bn=fread(buf,1,SIZE,stdin),bi=0;}
        int sn=0;while (bn) {for (;bi<bn&&buf[bi]>' ';bi++) s[sn++]=buf[bi];if (bi<bn) break; bn=fread(buf,1,SIZE,stdin),bi=0;}s[sn]=0;return sn;
    }
    bool read(int& x) {if(x)x=0;int bf=0,n=read(str); if(!n)return 0; int i=0; if (str[i]=='-') bf=1,i=1; for(x=0;i<n;i++) x=x*10+str[i]-'0'; if(bf) x=-x; return 1;}
    void write(int x) {
        if(!x) obuf[opt++] = '0'; else {if(x<0) obuf[opt++]='-',x=-x;int sn=0; while(x)str[sn++]=x%10+'0',x/=10;for (int i=sn-1;i>=0;i--) obuf[opt++]=str[i];}
        if (opt>=(SIZE>>1)){fwrite(obuf, 1, opt, stdout); opt=0;}
    }
    void write(char x) {obuf[opt++]=x;if (opt>=(SIZE>>1)){fwrite(obuf, 1, opt, stdout); opt=0;}}
    void Fflush() { if (opt) fwrite(obuf, 1, opt, stdout); opt=0;}
};
const int MAXN = 2e5 + 5;
int q, s[MAXN], t[MAXN];
struct Tree {
	int n, s1[MAXN], s2[MAXN], f[MAXN][20], ok = 1, dep[MAXN];
	vector < int > e[MAXN];
	void addedge(int u, int v) {e[u].pb(v);}
	void dfs(int u, int fa) {
		dep[u] = dep[fa] + 1;
		f[u][0] = fa; For(i, 1, 19) f[u][i] = f[f[fa][i-1]][i-1];
		for(auto v : e[u]) if(v != fa) dfs(v, u);
	}
	int lca(int u, int v) {
		if(dep[u] > dep[v]) swap(u, v);
		foR(i, 19, 0) if(dep[f[u][i]] < dep[v]) u = f[u][i];
		foR(i, 19, 0) {
			if(f[u][i] != f[v][i]) u = f[u][i], v = f[v][i];
		}
		return f[u][0];
	}
	void check(int u, int fa) {
		for(auto v : e[u]) {
			if(v == fa) continue;
			check(v, u);
			s1[u] += s1[v], s2[u] += s2[v];
		}
		if(s1[u] && s2[u]) ok = 0;
//		assert(s1[u] >= 0);assert(s2[u] >= 0);
	}
	bool solve() {
		For(i, 1, n) if(!f[i][0]) dfs(i, i);
//		For(i, 1, q) {
//			if(f[s[i]][19] != f[t[i]][19]) return 0;
//		}
		For(i, 1, q) {
			int u = s[i], v = t[i], l = lca(u, v);
			s1[u]++, s1[l]--; s2[v]++, s2[l]--;
		}
		For(i, 1, n) {
			if(f[i][0] == i) check(i, i);
		}
		return ok;
	}

}T;
struct Graph {
	int n, m, bel[MAXN];
	map < Pair, int > cnt;
	vector < int > e[MAXN];
	int dfn[MAXN], low[MAXN], ind = 0, S[MAXN], top = 0, vis[MAXN<<1];
	void tarjan(int u, int fa) {
		dfn[u] = low[u] = ++ind; S[++top] = u;
		for(auto v : e[u]) {
			if(v == fa && cnt[mkp(u, v)] == 1) continue;
			if(dfn[v]) {
				low[u] = min(low[u], dfn[v]);
			} else {
				tarjan(v, u);
				low[u] = min(low[u], low[v]);
			}
		}
		if(low[u] == dfn[u]) {
//			cerr << u << endl;
			++T.n;
			while(S[top] != u)
				bel[S[top--]] = T.n;
			bel[S[top--]] = T.n;
		}
	}
	void init() {
		FI(n); FI(m); FI(q);
		while(m--) {
			int u = 0, v = 0; FI(u); FI(v);
			e[u].pb(v); e[v].pb(u); cnt[mkp(u, v)]++, cnt[mkp(v, u)]++;
		}
		For(i, 1, n) if(!dfn[i]) tarjan(i, 0);
//		For(i, 1, n) cerr << bel[i] << endl;
		For(u, 1, n) {
			for(auto v : e[u])
				if(bel[u] != bel[v]) T.addedge(bel[u], bel[v]);
		}
		For(i, 1, q) {
			FI(s[i]); FI(t[i]);
			s[i] = bel[s[i]], t[i] = bel[t[i]];
//			cerr << i << ' ' << s[i] << ' ' << t[i] << '*' << endl;
			if(s[i] == t[i]) i--, q--;
		}
//		For(i, 1, q) cerr << s[i] <<endl;
	}
}G;

signed main()
{
	#ifndef ONLINE_JUDGE
		file("pro");
	#endif
	G.init();
//	For(i, 1, q) cerr << s[i] << endl;
	printf(T.solve() ? "Yes\n" : "No\n");
    return FastIO::Fflush(), 0;
}
/*

*/


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mkp make_pair
#define rint register int
#define INF ((1 << 30) - 1)
#define FI(n) FastIO::read(n)
#define FO(n) FastIO::write(n)
#define Pair pair < int, int >
#define mst(a,b) memset(a,b,sizeof(a))
#define foR(i, k, j) for(rint i = (k); i >= (j); i--)
#define For(i, k, j) for(rint i = (k); i <= (j); i++)
#define Foe(i, u) for(rint i = lst[u], v = e[i].v; i; i = e[i].nxt, v = e[i].v)
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define file(s) freopen(s".in", "r", stdin); freopen(s".out", "w", stdout)
//#define int long long
const int P = 998244353; //
using namespace std;
inline void ckmax(int &a, int b) {a = max(a, b);}
inline void ckmin(int &a, int b) {a = min(a, b);}
inline void mulmod(int &a, int b) {a = 1ll * a * b % P;}
inline void addmod(int &a, int b) {int t = a + b; a = (t >= P ? t - P : t); }
inline int ksm(int a, int b) {int ans=1; for(;b;b>>=1) {if(b&1) ans=1ll*ans*a%P;a=1ll*a*a%P;}return ans;}
inline int inv(int a) {return ksm(a, P-2);}
namespace FastIO {
    const int SIZE=1<<16; char buf[SIZE], obuf[SIZE], str[64]; int bi=SIZE, bn=SIZE, opt;
    int read(char *s) {
        while (bn) {for (;bi<bn&&buf[bi]<=' ';bi++);if (bi<bn) break; bn=fread(buf,1,SIZE,stdin),bi=0;}
        int sn=0;while (bn) {for (;bi<bn&&buf[bi]>' ';bi++) s[sn++]=buf[bi];if (bi<bn) break; bn=fread(buf,1,SIZE,stdin),bi=0;}s[sn]=0;return sn;
    }
    bool read(int& x) {if(x)x=0;int bf=0,n=read(str); if(!n)return 0; int i=0; if (str[i]=='-') bf=1,i=1; for(x=0;i<n;i++) x=x*10+str[i]-'0'; if(bf) x=-x; return 1;}
    void write(int x) {
        if(!x) obuf[opt++] = '0'; else {if(x<0) obuf[opt++]='-',x=-x;int sn=0; while(x)str[sn++]=x%10+'0',x/=10;for (int i=sn-1;i>=0;i--) obuf[opt++]=str[i];}
        if (opt>=(SIZE>>1)){fwrite(obuf, 1, opt, stdout); opt=0;}
    }
    void write(char x) {obuf[opt++]=x;if (opt>=(SIZE>>1)){fwrite(obuf, 1, opt, stdout); opt=0;}}
    void Fflush() { if (opt) fwrite(obuf, 1, opt, stdout); opt=0;}
};
const int MAXN = 2e5 + 5;
int q, s[MAXN], t[MAXN];
struct Tree {
	int n, s1[MAXN], s2[MAXN], f[MAXN][20], ok = 1, dep[MAXN];
	vector < int > e[MAXN];
	void addedge(int u, int v) {e[u].pb(v);}
	void dfs(int u, int fa) {
		dep[u] = dep[fa] + 1;
		f[u][0] = fa; For(i, 1, 19) f[u][i] = f[f[fa][i-1]][i-1];
		for(auto v : e[u]) if(v != fa) dfs(v, u);
	}
	inline int lca(int u, int v) {
		if(dep[u] < dep[v]) swap(u, v);
		foR(i, 19, 0) if(dep[f[u][i]] >= dep[v]) u = f[u][i];
//		cerr << dep[u] << ' ' << dep[v]<< endl;
		if(u == v) return u;
		foR(i, 19, 0)
			if(f[u][i] != f[v][i]) u = f[u][i], v = f[v][i];
		return f[u][0];
	}
	void check(int u, int fa) {
		for(auto v : e[u]) {
			if(v == fa) continue;
			check(v, u);
			s1[u] += s1[v], s2[u] += s2[v];
		}
//		cerr << u << ' ' << s1[u] << ' ' << s2[u] << endl;
		if(dep[u] != 1 && s1[u] && s2[u]) ok = 0;
//		cerr << u << endl;
//		assert(s1[u] >= 0);assert(s2[u] >= 0);
	}
	bool solve() {
		For(i, 1, n) if(!f[i][0]) dfs(i, i);
		For(i, 1, q) {
			if(f[s[i]][19] != f[t[i]][19]) return 0;
		}
		For(i, 1, q) {
			int u = s[i], v = t[i], l = lca(u, v);
//			cerr << u << ' ' << v << ' ' << l << endl;
			s1[u]++, s1[l]--; s2[v]++, s2[l]--;
		}
//		cerr << endl;
		For(i, 1, n) {
			if(dep[i] == 1) assert(f[i] == i), check(i, i);
		}
		return ok;
	}

}T;
struct Graph {
	int n, m, bel[MAXN];
	map < Pair, int > cnt;
	vector < int > e[MAXN];
	int dfn[MAXN], low[MAXN], ind = 0, S[MAXN], top = 0, vis[MAXN<<1];
	void tarjan(int u, int fa) {
		dfn[u] = low[u] = ++ind; S[++top] = u;
		for(auto v : e[u]) {
			if(v == fa && cnt[mkp(u, v)] == 1) continue;
			if(dfn[v]) {
				low[u] = min(low[u], dfn[v]);
			} else {
				tarjan(v, u);
				low[u] = min(low[u], low[v]);
			}
		}
		if(low[u] == dfn[u]) {
//			cerr << u << endl;
			++T.n;
			while(S[top] != u)
				bel[S[top--]] = T.n;
			bel[S[top--]] = T.n;
		}
	}
	void init() {
		FI(n); FI(m); FI(q);
		while(m--) {
			int u = 0, v = 0; FI(u); FI(v);
			e[u].pb(v); e[v].pb(u); cnt[mkp(u, v)]++, cnt[mkp(v, u)]++;
		}
		For(i, 1, n) if(!dfn[i]) tarjan(i, 0);
//		For(i, 1, n) cerr << bel[i] << endl;
//		cerr << endl;
		For(u, 1, n) {
			for(auto v : e[u])
				if(bel[u] != bel[v]) T.addedge(bel[u], bel[v]);
		}
		For(i, 1, q) {
			FI(s[i]); FI(t[i]);
			s[i] = bel[s[i]], t[i] = bel[t[i]];
//			cerr << i << ' ' << s[i] << ' ' << t[i] << '*' << endl;
			if(s[i] == t[i]) i--, q--;
		}
//		For(i, 1, q) cerr << s[i] <<endl;
	}
}G;

signed main()
{
	#ifndef ONLINE_JUDGE
		file("pro");
	#endif
	G.init();
//	For(i, 1, q) cerr << s[i] << endl;
	printf(T.solve() ? "Yes\n" : "No\n");
    return FastIO::Fflush(), 0;
}
/*

*/


#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll int
#define N 200005
#define inf (1e9)
#define rep(i,j,k) for (ll i=j;i<=k;++i)
#define per(i,j,k) for (ll i=j;i>=k;--i)
using namespace std;
inline ll read(){
	char ch=getchar(); ll x=0,f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return x*f;
}
ll n,m,k,tot1=1,tot2,cnt,num,color,top,vis[N],dfn[N],flag[N],low[N],q[N],tag[N];
ll head[N],Head[N],fa[N][20],belong[N],deep[N],f[N],g[N];
struct edge{ ll to,next; }e[N<<1],E[N<<1];
void add(ll u,ll v){
	e[++tot1]=(edge){v,head[u]}; head[u]=tot1;
}
void Add(ll u,ll v){
	E[++tot2]=(edge){v,Head[u]}; Head[u]=tot2;
}
void tarjan(ll u,ll last){
	dfn[u]=low[u]=++num; flag[u]=1; q[++top]=u; tag[u]=cnt;
	for (ll i=head[u],v=e[i].to;i;i=e[i].next,v=e[i].to){
		if (i==(last^1)) continue;
		if (!dfn[v]) { tarjan(v,i); low[u]=min(low[u],low[v]); }
		else if (flag[v]) low[u]=min(low[u],dfn[v]);
	}
	if (low[u]==dfn[u]){
		ll k; ++color;
		do{
			k=q[top--];
			flag[k]=0;
			belong[k]=color;
		}while (k!=u);
	}
}
void dfs(ll u,ll last){
	vis[u]=1;
	rep(i,1,18) fa[u][i]=fa[fa[u][i-1]][i-1];
	for (ll i=Head[u],v=E[i].to;i;i=E[i].next,v=E[i].to){
		if (v==last) continue;
		deep[v]=deep[u]+1; fa[v][0]=u; dfs(v,u);
	}
}
ll lca(ll x,ll y){
	if (deep[x]<deep[y]) swap(x,y);
	ll t=deep[x]-deep[y];
	rep(i,0,18) if ((t>>i)&1) x=fa[x][i];
	per(i,18,0) if (fa[x][i]!=fa[y][i]){
		x=fa[x][i]; y=fa[y][i];
	}
	if (x==y) return x;
	else return fa[x][0];
}
void get(ll u){
	vis[u]=1;
	for (ll i=Head[u],v=E[i].to;i;i=E[i].next,v=E[i].to){
		if (v==fa[u][0]) continue;
		get(v); f[u]+=f[v]; g[u]+=g[v];
	}
}
int main(){
	freopen("A.in","r",stdin);
	n=read(); m=read(); k=read();
	rep(i,1,m){
		ll u=read(),v=read();
		add(u,v); add(v,u);
	}
	rep(i,1,n) if (!dfn[i]) { ++cnt; tarjan(i,inf); }
	rep(u,1,n) for (ll i=head[u],v=e[i].to;i;i=e[i].next,v=e[i].to)
		if (belong[u]!=belong[v]) Add(belong[u],belong[v]);
	rep(i,1,color) if (!vis[i]) dfs(i,-1);
	rep(i,1,k){
		ll x=read(),y=read(),z;
		if (tag[x]!=tag[y]) return puts("NO")&0;
		x=belong[x]; y=belong[y]; z=lca(x,y);
		++f[x]; ++g[y]; --f[z]; --g[z];
	}
	memset(vis,0,sizeof vis);
	rep(i,1,color) if (!vis[i]) get(i);
	rep(i,1,color) if (f[i]&&g[i]) return puts("NO")&0;
	puts("YES");
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll int
#define N 200005
#define inf (1e9)
#define rep(i,j,k) for (ll i=j;i<=k;++i)
#define per(i,j,k) for (ll i=j;i>=k;--i)
using namespace std;
inline ll read(){
	char ch=getchar(); ll x=0,f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return x*f;
}
ll n,m,k,tot1=1,tot2,cnt,num,color,top,vis[N],dfn[N],flag[N],low[N],q[N],tag[N];
ll head[N],Head[N],fa[N][20],belong[N],deep[N],f[N],g[N];
struct edge{ ll to,next; }e[N<<1],E[N<<1];
void add(ll u,ll v){
	e[++tot1]=(edge){v,head[u]}; head[u]=tot1;
}
void Add(ll u,ll v){
	E[++tot2]=(edge){v,Head[u]}; Head[u]=tot2;
}
void tarjan(ll u,ll last){
	dfn[u]=low[u]=++num; flag[u]=1; q[++top]=u; tag[u]=cnt;
	for (ll i=head[u],v=e[i].to;i;i=e[i].next,v=e[i].to){
		if (i==(last^1)) continue;
		if (!dfn[v]) { tarjan(v,i); low[u]=min(low[u],low[v]); }
		else if (flag[v]) low[u]=min(low[u],dfn[v]);
	}
	if (low[u]==dfn[u]){
		ll k; ++color;
		do{
			k=q[top--];
			flag[k]=0;
			belong[k]=color;
		}while (k!=u);
	}
}
void dfs(ll u,ll last){
	vis[u]=1;
	rep(i,1,18) fa[u][i]=fa[fa[u][i-1]][i-1];
	for (ll i=Head[u],v=E[i].to;i;i=E[i].next,v=E[i].to){
		if (v==last) continue;
		deep[v]=deep[v]+1; fa[v][0]=u; dfs(v,u);
	}
}
ll lca(ll x,ll y){
	if (deep[x]<deep[y]) swap(x,y);
	ll t=deep[x]-deep[y];
	rep(i,0,18) if ((t>>i)&1) x=fa[x][i];
	per(i,18,0) if (fa[x][i]!=fa[y][i]){
		x=fa[x][i]; y=fa[y][i];
	}
	if (x==y) return x;
	else return fa[x][0];
}
void get(ll u){
	vis[u]=1;
	for (ll i=Head[u],v=E[i].to;i;i=E[i].next,v=E[i].to){
		if (v==fa[u][0]) continue;
		get(v); f[u]+=f[v]; g[u]+=g[v];
	}
}
int main(){
	n=read(); m=read(); k=read();
	rep(i,1,m){
		ll u=read(),v=read();
		add(u,v); add(v,u);
	}
	rep(i,1,n) if (!dfn[i]) { ++cnt; tarjan(i,inf); }
	rep(u,1,n) for (ll i=head[u],v=e[i].to;i;i=e[i].next,v=e[i].to)
		if (belong[u]!=belong[v]) Add(belong[u],belong[v]);
	rep(i,1,color) if (!vis[i]) dfs(i,-1);
	rep(i,1,k){
		ll x=read(),y=read(),z;
		if (tag[x]!=tag[y]) return puts("NO")&0;
		x=belong[x]; y=belong[y]; z=lca(x,y);
		++f[x]; ++g[y]; --f[z]; --g[z];
	}
	memset(vis,0,sizeof vis);
	rep(i,1,color) if (!vis[i]) get(i);
	rep(i,1,color) if (f[i]&&g[i]) return puts("NO")&0;
	puts("YES");
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll int
#define N 200005
#define inf (1e9)
#define rep(i,j,k) for (ll i=j;i<=k;++i)
#define per(i,j,k) for (ll i=j;i>=k;--i)
using namespace std;
inline ll read(){
	char ch=getchar(); ll x=0,f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return x*f;
}
ll n,m,k,tot1=1,tot2,cnt,num,color,top,vis[N],dfn[N],flag[N],low[N],q[N],tag[N];
ll head[N],Head[N],fa[N][20],belong[N],deep[N],f[N],g[N];
struct edge{ ll to,next; }e[N<<1],E[N<<1];
void add(ll u,ll v){
	e[++tot1]=(edge){v,head[u]}; head[u]=tot1;
}
void Add(ll u,ll v){
	E[++tot2]=(edge){v,Head[u]}; Head[u]=tot2;
}
void tarjan(ll u,ll last){
	dfn[u]=low[u]=++num; flag[u]=1; q[++top]=u; tag[u]=cnt;
	for (ll i=head[u],v=e[i].to;i;i=e[i].next,v=e[i].to){
		if (i==(last^1)) continue;
		if (!dfn[v]) { tarjan(v,i); low[u]=min(low[u],low[v]); }
		else if (flag[v]) low[u]=min(low[u],dfn[v]);
	}
	if (low[u]==dfn[u]){
		ll k; ++color;
		do{
			k=q[top--];
			flag[k]=0;
			belong[k]=color;
		}while (k!=u);
	}
}
void dfs(ll u,ll last){
	vis[u]=1;
	rep(i,1,18) fa[u][i]=fa[fa[u][i-1]][i-1];
	for (ll i=Head[u],v=E[i].to;i;i=E[i].next,v=E[i].to){
		if (v==last) continue;
		deep[v]=deep[u]+1; fa[v][0]=u; dfs(v,u);
	}
}
ll lca(ll x,ll y){
	if (deep[x]<deep[y]) swap(x,y);
	ll t=deep[x]-deep[y];
	rep(i,0,18) if ((t>>i)&1) x=fa[x][i];
	per(i,18,0) if (fa[x][i]!=fa[y][i]){
		x=fa[x][i]; y=fa[y][i];
	}
	if (x==y) return x;
	else return fa[x][0];
}
void get(ll u){
	vis[u]=1;
	for (ll i=Head[u],v=E[i].to;i;i=E[i].next,v=E[i].to){
		if (v==fa[u][0]) continue;
		get(v); f[u]+=f[v]; g[u]+=g[v];
	}
}
int main(){
//	freopen("A.in","r",stdin);
	n=read(); m=read(); k=read();
	rep(i,1,m){
		ll u=read(),v=read();
		add(u,v); add(v,u);
	}
	rep(i,1,n) if (!dfn[i]) { ++cnt; tarjan(i,inf); }
	rep(u,1,n) for (ll i=head[u],v=e[i].to;i;i=e[i].next,v=e[i].to)
		if (belong[u]!=belong[v]) Add(belong[u],belong[v]);
	rep(i,1,color) if (!vis[i]) dfs(i,-1);
	rep(i,1,k){
		ll x=read(),y=read(),z;
		if (tag[x]!=tag[y]) return puts("NO")&0;
		x=belong[x]; y=belong[y]; z=lca(x,y);
		++f[x]; ++g[y]; --f[z]; --g[z];
	}
	memset(vis,0,sizeof vis);
	rep(i,1,color) if (!vis[i]) get(i);
	rep(i,1,color) if (f[i]&&g[i]) return puts("NO")&0;
	puts("YES");
}


#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+10;
inline int read()
{
	register int x = 0 , f = 0; register char c = getchar();
	while(c < '0' || c > '9') f |= c == '-' , c = getchar();
	while(c >= '0' && c <= '9') x = (x << 3) + (x << 1) + (c ^ 48) , c = getchar();
	return f ? -x : x;
}
int n , m , q , cnt = 1 , dfn_id , col_id , tag_id;
int head[N] , dfn[N] , vis[N << 1] , low[N] , col[N] , tag[N] , d[N] , s1[N] , s2[N] , f[N][20];
vector<int> G[N];
struct edge { int v , nex; }e[N << 1];
inline void add(int u , int v) { e[++cnt].v = v; e[cnt].nex = head[u]; head[u] = cnt; }

void Tarjan(int x , int f)
{
	dfn[x] = low[x] = ++dfn_id;
	for(int i = head[x] , v; i ; i = e[i].nex) if(i != f)
	{
		v = e[i].v;
		if(!dfn[v])
		{
			Tarjan(v , i ^ 1) , low[x] = min(low[x] , low[v]);
			if(low[v] > dfn[x]) vis[i] = vis[i ^ 1] = 1;
		}
		else low[x] = min(low[x] , dfn[v]);
	}
}

void dfs1(int x)
{
	col[x] = col_id;
	for(int i = head[x] ; i ; i = e[i].nex) if(!col[e[i].v] && !vis[i]) dfs1(e[i].v);
}

void dfs2(int x)
{
	tag[x] = tag_id;
	for(auto v : G[x]) if(v != f[x][0])
	{
		f[v][0] = x; d[v] = d[x] + 1;
		for(int i = 1 ; i < 20 ; ++i) f[v][i] = f[f[v][i-1]][i-1];
		dfs2(v);
	}
}

int LCA(int x , int y)
{
	if(d[x] < d[y]) swap(x , y);
	for(int i = 19 ; ~i ; --i) if(d[f[x][i]] >= d[y]) x = f[x][i];
	if(x == y) return x;
	for(int i = 19 ; ~i ; --i) if(f[x][i] != f[y][i]) x = f[x][i] , y = f[y][i];
	return f[x][0];
}

bool check(int x)
{
	for(auto v : G[x]) if(v != f[x][0])
	{
		if(!check(v) || (s1[v] && s2[v])) return false;
		s1[x] += s1[v]; s2[x] += s2[v];
	}
	return true;
}

int main()
{
	n = read(); m = read(); q = read();
	for(int i = 1 , u , v; i <= m ; ++i) u = read() , v = read() , add(u , v) , add(v , u);
	for(int i = 1 ; i <= n ; ++i) if(!dfn[i]) Tarjan(i , -1);
	for(int i = 1 ; i <= n ; ++i) if(!col[i]) col_id++ , dfs1(i);
	for(int i = 1 ; i <= n ; ++i) for(int j = head[i] ; j ; j = e[j].nex) if(col[i] < col[e[j].v]) G[col[i]].push_back(col[e[j].v]) , G[col[e[j].v]].push_back(col[i]);
	for(int i = 1 ; i <= col_id ; ++i) if(!tag[i]) tag_id++ , d[i] = 1 , dfs2(i);
	for(int i = 1 , u , v ; i <= q ; ++i)
	{
		u = read(); v = read(); u = col[u]; v = col[v]; if(u == v) continue;
		if(tag[u] != tag[v]) return puts("No") , 0;
		int p = LCA(u , v);
		s1[u]++; s1[p]--; s2[v]++; s2[p]--;
	}
	for(int i = 1 ; i <= col_id ; ++i) if(d[i] == 1 && !check(i)) return puts("No") , 0;
	puts("Yes");
	return 0;
}


#include <algorithm>
#include <iostream>
#include <utility>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <vector>
using namespace std;
const int MAXN=4e5+5;
struct Edge
{
	int to,nxt;
	Edge()=default;
	Edge(int x,int y)
		: to(x),nxt(y) { }
}e[MAXN];
int head[MAXN],edge_cnt=1;
vector<int> v[MAXN];
int st[MAXN],top,dfn[MAXN],low[MAXN],dfn_cnt;
int n,m,q,tot,co[MAXN],co_cnt,rt[MAXN],sum1[MAXN],sum2[MAXN];
inline int read()
{
	int x=0;char ch=getchar();
	while(!isdigit(ch)) ch=getchar();
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x;
}
inline void add(int x,int y)
{
	e[++edge_cnt]=Edge(y,head[x]);
	head[x]=edge_cnt;
}
inline void add_edge(int x,int y)
{
	add(x,y),add(y,x);
}
inline void Min(int &x,int y)
{
	if(x>y) x=y;
}
void tarjan(int x,int fa)
{
	st[++top]=x;
	dfn[x]=low[x]=++dfn_cnt;
	for(int i=head[x];i;i=e[i].nxt)
	{
		int y=e[i].to;
		if(i==fa) continue;
		if(!dfn[y])
		{
			tarjan(y,i^1);
			Min(low[x],low[y]);
		}
		else if(!co[y])
			Min(low[x],dfn[y]);
	}
	if(dfn[x]==low[x])
	{
		++co_cnt;
		while(st[top]!=x)
			co[st[top--]]=co_cnt;
		co[st[top--]]=co_cnt;
	}
}
inline void rebuild()
{
	for(int x=1;x<=n;x++)
		for(int i=head[x];i;i=e[i].nxt)
		{
			int y=e[i].to;
			if(co[x]==co[y]) continue;
			v[co[x]].push_back(co[y]);
			v[co[y]].push_back(co[x]);
		}
}

namespace LCA
{
	int fa[MAXN],dep[MAXN],root[MAXN];
	int siz[MAXN],son[MAXN],top[MAXN];

	void dfs_son(int x,int fath,int rt)
	{
		siz[x]=1;
		fa[x]=fath;
		root[x]=rt;
		dep[x]=dep[fath]+1;
		for(auto y:v[x])
		{
			if(y==fath) continue;
			dfs_son(y,x,rt),siz[x]+=siz[y];
			if(siz[y]>siz[son[x]]) son[x]=y;
		}
	}
	void dfs_chain(int x,int tp)
	{
		top[x]=tp;
		if(son[x]) dfs_chain(son[x],tp);
		for(auto y:v[x])
		{
			if(y==fa[x]||y==son[x])
				continue;
			dfs_chain(y,y);
		}
	}
	inline int query_lca(int x,int y)
	{
		while(top[x]!=top[y])
		{
			if(dep[top[x]]<dep[top[y]]) swap(x,y);
			x=fa[top[x]];
		}
		return dep[x]<dep[y]?x:y;
	}
}

using LCA::fa;
using LCA::siz;
using LCA::root;
using LCA::query_lca;

void dfs_sum(int x)
{
	for(auto y:v[x])
		if(y!=fa[x])
			dfs_sum(y),
			sum1[x]+=sum1[y],
			sum2[x]+=sum2[y];
	if(sum1[x]&&sum2[x])
		{ puts("No");exit(0); }
}

int main()
{
	n=read(),m=read(),q=read();
	for(int i=1;i<=m;i++)
	{
		int x=read(),y=read();
		add_edge(x,y);
	}
	for(int i=1;i<=n;i++)
		if(!dfn[i])
			tarjan(i,0);
	rebuild();
	for(int i=1;i<=co_cnt;i++)
		if(!siz[i])
			LCA::dfs_son(i,0,++tot),
			LCA::dfs_chain(i,i),rt[tot]=i;
	for(int i=1;i<=q;i++)
	{
		int x=co[read()],y=co[read()];
		if(x==y) continue;
		if(root[x]!=root[y])
			{ puts("No");return 0; }
		int lca=query_lca(x,y);
		sum1[x]++,sum1[lca]--;
		sum2[y]++,sum2[lca]--;
	}
	for(int i=1;i<=tot;i++)
		dfs_sum(rt[i]);
	puts("Yes");
	return 0;
}


#pragma GCC optimize("-Ofast","-funroll-all-loops")
#include<bits/stdc++.h>
//#define int long long
using namespace std;
const int N=2e5+10,M=N<<1;
int n,m,q,tim,bk[N],pz[N],pf[N];
int pos[N],f[N],sz[N],son[N],bl[N],dep[N],idx;
int dfn[N],low[N],dcc[N],vis[N],brige[M],cnt,co; stack<int> s;
int head[N],nex[M],to[M],tot=1;
vector<int> g[N];
inline void add(int a,int b){to[++tot]=b; nex[tot]=head[a]; head[a]=tot;}
void Tarjan(int x){
	low[x]=dfn[x]=++cnt;	s.push(x),vis[x]=1;	bk[x]=tim;
	for(int i=head[x];i;i=nex[i]){
		if(brige[i])	continue;	brige[i]=brige[i^1]=1;
		if(!dfn[to[i]])	Tarjan(to[i]),low[x]=min(low[x],low[to[i]]);
		else if(vis[to[i]]) low[x]=min(low[x],dfn[to[i]]);
	}
	if(dfn[x]==low[x]){
		int u;	co++;
		do{
			u=s.top(); s.pop(); dcc[u]=co; vis[u]=0;
		}while(u!=x);
	}
}
void dfs1(int x,int fa){
	sz[x]=1;
	for(auto to:g[x]){
		if(to==fa)	continue;
		f[to]=x;	dep[to]=dep[x]+1;
		dfs1(to,x);	sz[x]+=sz[to];
		if(sz[to]>sz[son[x]])	son[x]=to;
	}
}
void dfs2(int x,int belong){
	pos[x]=++idx;	bl[x]=belong;
	if(son[x])	dfs2(son[x],belong);
	for(auto to:g[x])	if(dep[to]>dep[x]&&to!=son[x])	dfs2(to,to);
}
inline int lca(int x,int y){
	while(bl[x]!=bl[y]){
		if(dep[bl[x]]<dep[bl[y]])	swap(x,y);	x=f[bl[x]];
	}
	return dep[x]>dep[y]?y:x;
}
void dfs(int x,int fa){
	for(auto to:g[x]){
		if(to==fa)	continue;
		dfs(to,x);	pz[x]+=pz[to],pf[x]+=pf[to];
	}
}
signed main(){
	cin>>n>>m>>q;
	for(int i=1,a,b;i<=m;i++)	scanf("%d %d",&a,&b),add(a,b),add(b,a);
	for(int i=1;i<=n;i++)	if(!dfn[i])	tim++,Tarjan(i);
	for(int i=1;i<=n;i++)	for(int j=head[i];j;j=nex[j])	if(dcc[i]!=dcc[to[j]]){
		g[dcc[i]].push_back(dcc[to[j]]);
	}
	for(int i=1;i<=co;i++)	if(!sz[i])	f[i]=i,dfs1(i,i),dfs2(i,i);
	for(int i=1,x,y,c;i<=q;i++){
		scanf("%d %d",&x,&y);
		if(bk[x]!=bk[y])	return puts("No"),0;
		x=dcc[x],y=dcc[y];
		if(x==y)	continue;	c=lca(x,y);
		pz[x]++,pz[c]--,pf[y]++,pf[c]--;
	}
	for(int i=1;i<=co;i++)	if(f[i]==i)	dfs(i,i);
	for(int i=1;i<=n;i++)	if(pz[i]&&pf[i])	return puts("No"),0;
	puts("Yes");
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int maxn = 100005, maxm = 100005;

vector<int> tree[maxn];
vector<int> graph[maxn];
int U[maxm],V[maxm];
bool isbridge[maxm];
int visited[maxn];
int times[maxn],T;
int cmpno;
queue<int> q[maxn];

int comp[maxn], comp2[maxn];

int adj(int u,int e)
{
    return U[e] == u ? V[e] : U[e];
}
int tarjan(int u,int edge)
{
	comp2[u] = cmpno;
    visited[u] = 1;
    times[u] = T++;
    int disc = times[u];
    for(int i = 0; i < graph[u].size(); i++)
    {
        int e = graph[u][i];
        int w = adj(u,e);
        if(!visited[w])
            disc = min(disc,tarjan(w,e));
        else if(e != edge)
            disc = min(disc,times[w]);
    }
    if(disc == times[u] && edge!=-1)
        isbridge[edge]=true;
    return disc;
}

void bridged_tree(int v)
{
    int currcmp = cmpno;
    q[currcmp].push(v);
    visited[v] = 1;
    while(!q[currcmp].empty())
    {
        int u = q[currcmp].front();
        q[currcmp].pop();
        comp[u] = currcmp;
        for(int i = 0;i < graph[u].size(); i++)
        {
            int e = graph[u][i];
            int w = adj(u,e);
            if(visited[w])
            	continue;
            if(isbridge[e])
            {
                cmpno++;
                tree[currcmp].push_back(cmpno);
                tree[cmpno].push_back(currcmp);
               	bridged_tree(w);
            }
            else
            {
                q[currcmp].push(w);
                visited[w] = 1;
            }
        }
    }
}

const int LOG = 20;

int level[maxn];
int ancestor[LOG][maxn];
int up[maxn],down[maxn];

void dfs_lca(int u, int p)
{
	visited[u] = 1;
	for(const auto &v : tree[u])
	{
		if(v == p || visited[v])
			continue;
		ancestor[0][v] = u;
		level[v] = level[u] + 1;
		dfs_lca(v,u);
	}
}

void preprocess(int n)
{
	for(int i = 1; i < LOG ; i++)
	{
		for(int j = 1; j <= n ; j++)
			ancestor[i][j] = ancestor[i-1][ancestor[i-1][j]];
	}
}

int lca(int u, int v)
{
	if(level[u] > level[v])
		swap(u,v);

	int d = level[v] - level[u];
	for(int i = 0 ; i < LOG; i++)
	{
		if(d & (1 << i))
		{
			v = ancestor[i][v];
		}
	}

	if(v == u)
		return v;

	for(int i = LOG-1; i >= 0; i--)
	{
		if(ancestor[i][u] != ancestor[i][v])
		{
			u = ancestor[i][u];
			v = ancestor[i][v];
		}
	}

	return ancestor[0][u];
}

bool ok = 1;
void dfs3(int u, int p)
{
	visited[u] = 1;
	for(const auto &v : tree[u])
	{
		if(p == v || visited[v])
			continue;
		up[u] += up[v];
		down[u] += down[v];
	}
//	cout << u << " ----> " << up[u] << " " << down[u] << endl;
	if(up[u] > 0 && down[u] > 0)
		ok = false;
}

int main()
{
	int n,m,q;
	scanf("%d %d %d",&n,&m,&q);
	for(int i = 1; i <= m ; i++)
	{
		scanf("%d %d",&U[i], &V[i]);
		graph[U[i]].push_back(i);
		graph[V[i]].push_back(i);
	}

	memset(visited,0,sizeof(visited));
	for(int i = 1; i <= n ; i++)
	{
		if(visited[i] == 0)
		{
			tarjan(i,-1);
			cmpno++;
		}
	}
	memset(visited,0,sizeof(visited));
	cmpno = 0;
	for(int i = 1; i <= n ; i++)
	{
		if(visited[i] == 0)
		{
			bridged_tree(i);
			cmpno++;
		}
	}

	memset(visited,0,sizeof(visited));
	for(int i = 0; i < cmpno ; i++)
	{
		if(visited[i] == 0)
		{
			level[i] = 0;
		//	ancestor[0][i] = i;
			dfs_lca(i,i);
		}
	}
	preprocess(cmpno);
	while(q--)
	{
		int u,v;
		scanf("%d %d",&u,&v);
		if(comp2[u] != comp2[v])
		{
			ok = false;
			continue;
		}

		if(comp[u] == comp[v])
			continue;
		u = comp[u];
		v = comp[v];
		int l = lca(u,v);
		if(ok)
		{
			up[u]++;
			down[v]++;
			up[l]--;
			down[l]--;
		}
	}
	memset(visited,0,sizeof(visited));
	for(int i = 0; i < n ; i++)
	{
		if(visited[i] == 0)
		{
			dfs3(i,-1);
		}
	}
	printf("%s\n",ok ? "Yes" : "No");

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int maxn = 100005, maxm = 100005;

vector<int> tree[maxn];
vector<int> graph[maxn];
int U[maxm],V[maxm];
bool isbridge[maxm];
int visited[maxn];
int times[maxn],T;
int cmpno;
queue<int> q[maxn];

int comp[maxn], comp2[maxn];

int adj(int u,int e)
{
    return U[e] == u ? V[e] : U[e];
}
int tarjan(int u,int edge)
{
	comp2[u] = cmpno;
    visited[u] = 1;
    times[u] = T++;
    int disc = times[u];
    for(int i = 0; i < graph[u].size(); i++)
    {
        int e = graph[u][i];
        int w = adj(u,e);
        if(!visited[w])
            disc = min(disc,tarjan(w,e));
        else if(e!=edge)
            disc = min(disc,times[w]);
    }
    if(disc == times[u] && edge!=-1)
        isbridge[edge]=true;
    return disc;
}

void bridged_tree(int v)
{
    int currcmp = cmpno;
    q[currcmp].push(v);
    visited[v] = 1;
    while(!q[currcmp].empty())
    {
        int u = q[currcmp].front();
        q[currcmp].pop();
        comp[u] = currcmp;
        for(int i = 0;i < graph[u].size(); i++)
        {
            int e = graph[u][i];
            int w = adj(u,e);
            if(visited[w])
            	continue;
            if(isbridge[e])
            {
                cmpno++;
                tree[currcmp].push_back(cmpno);
                tree[cmpno].push_back(currcmp);
               	bridged_tree(w);
            }
            else
            {
                q[currcmp].push(w);
                visited[w] = 1;
            }
        }
    }
}

const int LOG = 20;

int level[maxn];
int ancestor[LOG][maxn];
int up[maxn],down[maxn];

void dfs_lca(int u, int p)
{
	ancestor[0][u] = p;
	level[u] = level[p] + 1;
	visited[u] = 1;
	for(const auto &v : tree[u])
	{
		if(v == p || visited[v])
			continue;
		dfs_lca(v,u);
	}
}

void preprocess(int n)
{
	for(int i = 1; i < LOG ; i++)
	{
		for(int j = 1; j <= n ; j++)
			ancestor[i][j] = ancestor[i-1][ancestor[i-1][j]];
	}
}

int lca(int u, int v)
{
	if(level[u] > level[v])
		swap(u,v);

	int d = level[v] - level[u];
	for(int i = 0 ; i < LOG; i++)
	{
		if(d & (1 << i))
		{
			v = ancestor[i][v];
		}
	}

	if(v == u)
		return v;

	for(int i = LOG-1; i >= 0; i--)
	{
		if(ancestor[i][u] != ancestor[i][v])
		{
			u = ancestor[i][u];
			v = ancestor[i][v];
		}
	}

	return ancestor[0][u];
}

bool ok = 1;
void dfs3(int u, int p)
{
	visited[u] = 1;
	for(const auto &v : tree[u])
	{
		if(p == v || visited[v])
			continue;
		up[u] += up[v];
		down[u] += down[v];
	}
	//cout << u << " ----> " << up[u] << " " << down[u] << endl;
	if(up[u] > 0 || down[u] > 0)
		ok = false;
}

int main()
{
	int n,m,q;
	scanf("%d %d %d",&n,&m,&q);
	for(int i = 1; i <= m ; i++)
	{
		scanf("%d %d",&U[i], &V[i]);
		graph[U[i]].push_back(i);
		graph[V[i]].push_back(i);
	}

	memset(visited,0,sizeof(visited));
	for(int i = 1; i <= n ; i++)
	{
		if(visited[i] == 0)
		{
			tarjan(i,-1);
			cmpno++;
		}
	}
	memset(visited,0,sizeof(visited));
	cmpno = 0;
	for(int i = 1; i <= n ; i++)
	{
		if(visited[i] == 0)
		{
			bridged_tree(i);
			cmpno++;
		}
	}

	memset(visited,0,sizeof(visited));
	for(int i = 1; i <= n ; i++)
	{
		if(visited[i] == 0)
		{
			level[i] = 0;
			ancestor[0][i] = i;
			dfs_lca(i,i);
		}
	}
	preprocess(n);
	while(q--)
	{
		int u,v;
		scanf("%d %d",&u,&v);
		if(comp2[u] != comp2[v])
		{
			ok = false;
			continue;
		}

		if(comp[u] == comp[v])
			continue;
		u = comp[u];
		v = comp[v];
		int l = lca(u,v);

		up[u]++;
		down[v]++;
		up[l]--;
		down[l]--;

	}

	memset(visited,0,sizeof(visited));
	for(int i = 1; i <= n ; i++)
	{
		if(visited[i] == 0)
		{
			dfs3(i,-1);
		}
	}
	printf("%s\n",ok ? "Yes" : "No");

	return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int maxn = 200005, maxm = 200005;

vector<int> tree[maxn];
vector<int> graph[maxn];
int U[maxm],V[maxm];
bool isbridge[maxm];
int visited[maxn];
int times[maxn],T;
int cmpno;
queue<int> q[maxn];

int comp[maxn], comp2[maxn];

int adj(int u,int e)
{
    return U[e] == u ? V[e] : U[e];
}
int tarjan(int u,int edge)
{
	comp2[u] = cmpno;
    visited[u] = 1;
    times[u] = T++;
    int disc = times[u];
    for(int i = 0; i < graph[u].size(); i++)
    {
        int e = graph[u][i];
        int w = adj(u,e);
        if(!visited[w])
            disc = min(disc,tarjan(w,e));
        else if(e != edge)
            disc = min(disc,times[w]);
    }
    if(disc == times[u] && edge!=-1)
        isbridge[edge]=true;
    return disc;
}

void bridged_tree(int v)
{
    int currcmp = cmpno;
    q[currcmp].push(v);
    visited[v] = 1;
    while(!q[currcmp].empty())
    {
        int u = q[currcmp].front();
        q[currcmp].pop();
        comp[u] = currcmp;
        for(int i = 0;i < graph[u].size(); i++)
        {
            int e = graph[u][i];
            int w = adj(u,e);
            if(visited[w])
            	continue;
            if(isbridge[e])
            {
                cmpno++;
                tree[currcmp].push_back(cmpno);
                tree[cmpno].push_back(currcmp);
               	bridged_tree(w);
            }
            else
            {
                q[currcmp].push(w);
                visited[w] = 1;
            }
        }
    }
}

const int LOG = 20;

int level[maxn];
int ancestor[LOG][maxn];
int up[maxn],down[maxn];

void dfs_lca(int u, int p)
{
	visited[u] = 1;
	for(const auto &v : tree[u])
	{
		if(v == p || visited[v])
			continue;
		ancestor[0][v] = u;
		level[v] = level[u] + 1;
		dfs_lca(v,u);
	}
}

void preprocess(int n)
{
	for(int i = 1; i < LOG ; i++)
	{
		for(int j = 1; j <= n ; j++)
			ancestor[i][j] = ancestor[i-1][ancestor[i-1][j]];
	}
}

int lca(int u, int v)
{
	if(level[u] > level[v])
		swap(u,v);

	int d = level[v] - level[u];
	for(int i = 0 ; i < LOG; i++)
	{
		if(d & (1 << i))
		{
			v = ancestor[i][v];
		}
	}

	if(v == u)
		return v;

	for(int i = LOG-1; i >= 0; i--)
	{
		if(ancestor[i][u] != ancestor[i][v])
		{
			u = ancestor[i][u];
			v = ancestor[i][v];
		}
	}

	return ancestor[0][u];
}

bool ok = 1;
void dfs3(int u, int p)
{
	visited[u] = 1;
	for(const auto &v : tree[u])
	{
		if(p == v || visited[v])
			continue;
		up[u] += up[v];
		down[u] += down[v];
	}
//	cout << u << " ----> " << up[u] << " " << down[u] << endl;
	if(up[u] > 0 && down[u] > 0)
		ok = false;
}

int main()
{
	int n,m,q;
	scanf("%d %d %d",&n,&m,&q);
	for(int i = 1; i <= m ; i++)
	{
		scanf("%d %d",&U[i], &V[i]);
		graph[U[i]].push_back(i);
		graph[V[i]].push_back(i);
	}

	memset(visited,0,sizeof(visited));
	for(int i = 1; i <= n ; i++)
	{
		if(visited[i] == 0)
		{
			tarjan(i,-1);
			cmpno++;
		}
	}
	memset(visited,0,sizeof(visited));
	cmpno = 0;
	for(int i = 1; i <= n ; i++)
	{
		if(visited[i] == 0)
		{
			bridged_tree(i);
			cmpno++;
		}
	}

	memset(visited,0,sizeof(visited));
	for(int i = 0; i < cmpno ; i++)
	{
		if(visited[i] == 0)
		{
			level[i] = 0;
		//	ancestor[0][i] = i;
			dfs_lca(i,i);
		}
	}
	preprocess(cmpno);
	while(q--)
	{
		int u,v;
		scanf("%d %d",&u,&v);
		if(comp2[u] != comp2[v])
		{
			ok = false;
			continue;
		}

		if(comp[u] == comp[v])
			continue;
		u = comp[u];
		v = comp[v];
		int l = lca(u,v);
		if(ok)
		{
			up[u]++;
			down[v]++;
			up[l]--;
			down[l]--;
		}
	}
	memset(visited,0,sizeof(visited));
	for(int i = 0; i < n ; i++)
	{
		if(visited[i] == 0)
		{
			dfs3(i,-1);
		}
	}
	printf("%s\n",ok ? "Yes" : "No");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int P = 1e9 + 7;
int add(int a, int b) {if((a += b) >= P) a -= P; return a;}
int sub(int a, int b) {if((a -= b) < 0) a += P; return a;}
int mul(int a, int b) {return 1ll * a * b % P;}
int kpow(int a, int b) {int r=1;for(;b;b>>=1,a=mul(a,a)) {if(b&1)r=mul(r,a);}return r;}

const int N = 202020;

int n, m, q;
int dfn[N], low[N], id[N], st[N], _st, _;
int pre[N][22], cnt[N][2], dep[N];
bool vis[N];
vi g[N], ng[N];

void dfs2(int u, int fa) {
	vis[u] = 1;
	pre[u][0] = -1;
	rep(i, 1, 22) pre[u][i] = pre[pre[u][i-1]][i-1];
	dep[u] = dep[fa] + 1;
	for(auto v : ng[u]) if(!vis[v] && v != fa) dfs2(v, u);
}

void dfs(int c, int dep) {
	int cc = 0; st[_st++] = c;
	dfn[c] = low[c] = dep;
	for(auto t : g[c]) {
		if(!dfn[t]) {
			dfs(t, dep+1);
			low[c] = min(low[c], low[t]);
		} else if(dfn[t] != dfn[c] - 1 || cc++) {
			low[c] = min(low[c], dfn[t]);
		}
	}
	if(low[c] == dfn[c]) {
		do{id[st[--_st]] = _;}while(st[_st]!=c);
		_++;
	}
}

int lca(int u, int v) {
	if(dep[u] > dep[v]) swap(u, v);
	if(dep[u] != dep[v]) for(int i = 21; ~i; --i) if(dep[u] <= dep[pre[v][i]]) v = pre[v][i];
	if(u == v) return u;
	for(int i = 21; ~i; --i) if(pre[u][i] != pre[v][i]) u = pre[u][i], v = pre[v][i];
	return pre[u][0];
}

void dfs3(int u, int fa) {
	vis[u] = 1;
	for(auto v : ng[u]) if(!vis[v] && v != fa) {
		dfs3(v, u);
		rep(i, 0, 2) cnt[u][i] += cnt[v][i];
	}
}

bool solve() {
	rep(i, 0, q) {
		int u, v;
		cin >> u >> v;
		u = id[u-1], v = id[v-1];
		if(pre[u][21] != pre[v][21]) return 0;
		int x = lca(u, v);
		++cnt[u][0];
		--cnt[x][0];
		++cnt[v][1];
		--cnt[x][1];
	}
	memset(vis, 0, sizeof(vis));
	rep(i, 0, _) if(!vis[i]) dfs3(i, i);
	rep(i, 0, _) if(cnt[i][0] && cnt[i][1]) return 0;
	return 1;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	cin >> n >> m >> q;
	rep(i, 0, m) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		g[u].pb(v);
		g[v].pb(u);
	}
	rep(i, 0, n) if(!dfn[i]) dfs(i, 1);
	rep(i, 0, n) for(auto j : g[i]) if(id[i] != id[j]) ng[id[i]].pb(id[j]);
	rep(i, 0, _) if(!vis[i]) dfs2(i, i);
	cout << (solve()?"Yes":"No") << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int P = 1e9 + 7;
int add(int a, int b) {if((a += b) >= P) a -= P; return a;}
int sub(int a, int b) {if((a -= b) < 0) a += P; return a;}
int mul(int a, int b) {return 1ll * a * b % P;}
int kpow(int a, int b) {int r=1;for(;b;b>>=1,a=mul(a,a)) {if(b&1)r=mul(r,a);}return r;}

const int N = 202020;

int n, m, q;
int dfn[N], low[N], id[N], st[N], _st, _;
int pre[N][22], cnt[N][2], dep[N];
bool vis[N];
vi g[N], ng[N];

void dfs2(int u, int fa) {
	vis[u] = 1;
	pre[u][0] = fa;
	rep(i, 1, 22) pre[u][i] = pre[pre[u][i-1]][i-1];
	dep[u] = dep[fa] + 1;
	for(auto v : ng[u]) if(!vis[v] && v != fa) dfs2(v, u);
}

void dfs(int c, int dep) {
	int cc = 0; st[_st++] = c;
	dfn[c] = low[c] = dep;
	for(auto t : g[c]) {
		if(!dfn[t]) {
			dfs(t, dep+1);
			low[c] = min(low[c], low[t]);
		} else if(dfn[t] != dfn[c] - 1 || cc++) {
			low[c] = min(low[c], dfn[t]);
		}
	}
	if(low[c] == dfn[c]) {
		do{id[st[--_st]] = _;}while(st[_st]!=c);
		_++;
	}
}

int lca(int u, int v) {
	if(dep[u] > dep[v]) swap(u, v);
	if(dep[u] != dep[v]) for(int i = 21; ~i; --i) if(dep[u] <= dep[pre[v][i]]) v = pre[v][i];
	if(u == v) return u;
	for(int i = 21; ~i; --i) if(pre[u][i] != pre[v][i]) u = pre[u][i], v = pre[v][i];
	return pre[u][0];
}

void dfs3(int u, int fa) {
	vis[u] = 1;
	for(auto v : ng[u]) if(!vis[v] && v != fa) {
		dfs3(v, u);
		rep(i, 0, 2) cnt[u][i] += cnt[v][i];
	}
}

bool solve() {
	rep(i, 0, q) {
		int u, v;
		cin >> u >> v;
		u = id[u-1], v = id[v-1];
		if(pre[u][21] != pre[v][21]) return 0;
		int x = lca(u, v);
		++cnt[u][0];
		--cnt[x][0];
		++cnt[v][1];
		--cnt[x][1];
	}
	memset(vis, 0, sizeof(vis));
	rep(i, 0, _) if(!vis[i]) dfs3(i, i);
	rep(i, 0, _) if(cnt[i][0] && cnt[i][1]) return 0;
	return 1;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	cin >> n >> m >> q;
	rep(i, 0, m) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		g[u].pb(v);
		g[v].pb(u);
	}
	rep(i, 0, n) if(!dfn[i]) dfs(i, 1);
	rep(i, 0, n) for(auto j : g[i]) if(id[i] != id[j]) ng[id[i]].pb(id[j]);
	rep(i, 0, _) if(!vis[i]) dfs2(i, i);
	cout << (solve()?"Yes":"No") << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int P = 1e9 + 7;
int add(int a, int b) {if((a += b) >= P) a -= P; return a;}
int sub(int a, int b) {if((a -= b) < 0) a += P; return a;}
int mul(int a, int b) {return 1ll * a * b % P;}
int kpow(int a, int b) {int r=1;for(;b;b>>=1,a=mul(a,a)) {if(b&1)r=mul(r,a);}return r;}

const int N = 202020;

int n, m, q;
int dfn[N], low[N], id[N], st[N], _st, _;
int pre[N][22], cnt[N][2], dep[N];
bool vis[N];
vi g[N], ng[N];

void dfs2(int u, int fa) {
	vis[u] = 1;
	pre[u][0] = -1;
	rep(i, 1, 22) pre[u][i] = pre[pre[u][i-1]][i-1];
	dep[u] = dep[fa] + 1;
	for(auto v : ng[u]) if(!vis[v] && v != fa) dfs2(v, u);
}

void dfs(int c, int dep) {
	int cc = 0; st[_st++] = c;
	dfn[c] = low[c] = dep;
	for(auto t : g[c]) {
		if(!dfn[t]) {
			dfs(t, dep+1);
			low[c] = min(low[c], low[t]);
		} else if(dfn[t] != dfn[c] - 1 || cc++) {
			low[c] = min(low[c], dfn[t]);
		}
	}
	if(low[c] == dfn[c]) {
		do{id[st[--_st]] = c;}while(st[_st]!=c);
		_++;
	}
}

int lca(int u, int v) {
	if(dep[u] > dep[v]) swap(u, v);
	if(dep[u] != dep[v]) for(int i = 21; ~i; --i) if(dep[u] <= dep[pre[v][i]]) v = pre[v][i];
	if(u == v) return u;
	for(int i = 21; ~i; --i) if(pre[u][i] != pre[v][i]) u = pre[u][i], v = pre[v][i];
	return pre[u][0];
}

void dfs3(int u, int fa) {
	vis[u] = 1;
	for(auto v : ng[u]) if(!vis[v] && v != fa) {
		dfs3(v, u);
		rep(i, 0, 2) cnt[u][i] += cnt[v][i];
	}
}

bool solve() {
	rep(i, 0, q) {
		int u, v;
		cin >> u >> v;
		u = id[u-1], v = id[v-1];
		if(pre[u][21] != pre[v][21]) return 0;
		int x = lca(u, v);
		++cnt[u][0];
		--cnt[x][0];
		++cnt[v][1];
		--cnt[x][1];
	}
	memset(vis, 0, sizeof(vis));
	rep(i, 0, _) if(!vis[i]) dfs3(i, i);
	rep(i, 0, _) if(cnt[i][0] && cnt[i][1]) return 0;
	return 1;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	cin >> n >> m >> q;
	rep(i, 0, m) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		g[u].pb(v);
		g[v].pb(u);
	}
	rep(i, 0, n) if(!dfn[i]) dfs(i, 1);
	rep(i, 0, n) for(auto j : g[i]) if(id[i] != id[j]) ng[id[i]].pb(id[j]);
	rep(i, 0, _) if(!vis[i]) dfs2(i, i);
	cout << (solve()?"Yes":"No") << endl;
	return 0;
}


/********************************************************************************

	Code by a weak man named CYJian, and he hopes the code can get more points.

	Algorithm:

 ********************************************************************************/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//{{{ FAST IO AND SOME FUNCTIONS
const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;

#define ge (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
#define ri read_int()
#define rl read_ll()
#define ra read_alpha()
#define FILE(s) freopen(s"in", "r", stdin), freopen(s"out", "w", stdout)

template<typename T>
inline void read(T &x) {
	char ch, t = 0; x = 0;
	while(!isdigit(ch = ge)) t |= ch == '-';
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = ge;
	x = t ? -x : x;
}
inline char read_alpha() { char c = ge; while(!isalpha(c) && c != EOF) c = ge; return c; }
inline int read_int() { int x; return read(x), x; }
inline ll read_ll() { ll x; return read(x), x; }

template<typename T> inline void chkmin(T&a, T b) { a = a < b ? a : b; }
template<typename T> inline void chkmax(T&a, T b) { a = a > b ? a : b; }
//}}}

const int MAXN = 200010;

int N;
vector<int>to[MAXN];

//{{{ Graph

struct Graph {
	vector<int>to[MAXN];
	int fa[MAXN][20];
	int dep[MAXN];
	int up[MAXN];
	int dn[MAXN];

	inline void AddEdge(int u, int v) { to[u].push_back(v), to[v].push_back(u); }

	inline void dfs(int x, int la) {
		fa[x][0] = la, dep[x] = dep[la] + 1;
		for(int i = 1; i < 20; i++)
			fa[x][i] = fa[fa[x][i - 1]][i - 1];
		for(auto u : to[x]) {
			if(u == la) continue;
			dfs(u, x);
		}
	}

	inline int LCA(int x, int y) {
		if(dep[x] < dep[y]) swap(x, y);
		int k = dep[x] - dep[y];
		for(int i = 0; i < 20; i++)
			if(k & (1 << i)) x = fa[x][i];
		if(x == y) return x;
		for(int i = 19; ~i; --i)
			if(fa[x][i] != fa[y][i])
				x = fa[x][i], y = fa[y][i];
		return fa[x][0];
	}

	inline void Modify(int s, int t) {
		int lca = LCA(s, t);
		up[s]++, up[lca]--;
		dn[t]++, dn[lca]--;
	}

	inline int DFS(int x, int la) {
		for(auto u : to[x]) {
			if(u == la) continue;
			if(DFS(u, x)) return 1;
			up[x] += up[u], dn[x] += dn[u];
		} return up[x] && dn[x];
	}
}G;

//}}}

//{{{ Tarjan

struct UFS{
	int fa[MAXN];

	inline void init(int n) { for(int i = 1; i <= n; i++) fa[i] = i; }
	inline int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
	inline void Merge(int u, int v) { fa[find(u)] = find(v); }
}ufs;

struct Edge {
	int u, v;

	Edge() {}
	Edge(int u, int v):u(u), v(v) {}
}E[MAXN];

int tim;
int dfn[MAXN];
int low[MAXN];
int col[MAXN];

inline void Tarjan(int x, int la) {
	dfn[x] = low[x] = ++tim;
	for(auto u : to[x]) {
		if(u == la) { la = 0; continue; }
		if(!dfn[u]) Tarjan(u, x), chkmin(low[x], low[u]);
		chkmin(low[x], dfn[u]);
	}
}

inline void Col(int x) {
	if(col[x]) return ; col[x] = N;
	for(auto u : to[x]) Col(u);
}

inline void build(int n, int m) {
	for(int i = 1; i <= n; i++) to[i].clear();
	for(int i = 1; i <= m; i++) {
		int u = E[i].u, v = E[i].v;
		if(dfn[u] > dfn[v]) swap(u, v);
		if(dfn[u] >= low[v]) to[u].push_back(v), to[v].push_back(u);
	}
	for(int i = 1; i <= n; i++) if(!col[i]) ++N, Col(i);
	for(int i = 1; i <= m; i++) {
		int u = col[E[i].u], v = col[E[i].v];
		if(ufs.find(u) != ufs.find(v))
			ufs.Merge(u, v), G.AddEdge(u, v);
	}
}

//}}}

int main() {
#ifdef LOCAL
	FILE("");
#endif
	int n = ri, m = ri, q = ri;
	for(int i = 1; i <= m; i++) {
		int u = ri, v = ri;
		to[u].push_back(v);
		to[v].push_back(u);
		E[i] = Edge(u, v);
	}
	for(int i = 1; i <= n; i++) if(!dfn[i]) Tarjan(i, i);
	ufs.init(n), build(n, m);
	for(int i = 1; i <= N; i++) if(ufs.find(i) == i) G.dfs(i, 0);
	for(int i = 1; i <= q; i++) {
		int s = col[ri], t = col[ri];
		if(ufs.find(s) != ufs.find(t))
			return puts("No"), 0;
		G.Modify(s, t);
	} int res = 0;
	for(int i = 1; i <= N; i++) if(ufs.find(i) == i) res |= G.DFS(i, 0);
	puts(res ? "No" : "Yes");
	return 0;
}


/********************************************************************************

	Code by a weak man who named CYJian, and he hopes the code can get more points.

	Algorithm:

 ********************************************************************************/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//{{{ FAST IO AND SOME FUNCTIONS
const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;

#define ge (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
#define ri read_int()
#define rl read_ll()
#define ra read_alpha()
#define FILE(s) freopen(s"in", "r", stdin), freopen(s"out", "w", stdout)

template<typename T>
inline void read(T &x) {
	char ch, t = 0; x = 0;
	while(!isdigit(ch = ge)) t |= ch == '-';
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = ge;
	x = t ? -x : x;
}
inline char read_alpha() { char c = ge; while(!isalpha(c) && c != EOF) c = ge; return c; }
inline int read_int() { int x; return read(x), x; }
inline ll read_ll() { ll x; return read(x), x; }

template<typename T> inline void chkmin(T&a, T b) { a = a < b ? a : b; }
template<typename T> inline void chkmax(T&a, T b) { a = a > b ? a : b; }
//}}}

const int MAXN = 200010;

int N;
vector<int>to[MAXN];

//{{{ Graph

struct Graph {
	vector<int>to[MAXN];
	int fa[MAXN][20];
	int dep[MAXN];
	int up[MAXN];
	int dn[MAXN];
	int vis[MAXN];

	inline void AddEdge(int u, int v) { to[u].push_back(v), to[v].push_back(u); }

	inline void dfs(int x, int la) {
		fa[x][0] = la, dep[x] = dep[la] + 1;
		for(int i = 1; i < 20; i++)
			fa[x][i] = fa[fa[x][i - 1]][i - 1];
		for(auto u : to[x]) {
			if(u == la) continue;
			dfs(u, x);
		}
	}

	inline int LCA(int x, int y) {
		if(dep[x] < dep[y]) swap(x, y);
		int k = dep[x] - dep[y];
		for(int i = 0; i < 20; i++)
			if(k & (1 << i)) x = fa[x][i];
		if(x == y) return x;
		for(int i = 19; ~i; --i)
			if(fa[x][i] != fa[y][i])
				x = fa[x][i], y = fa[y][i];
		return fa[x][0];
	}

	inline void Modify(int s, int t) {
		int lca = LCA(s, t);
		up[s]++, up[lca]--;
		dn[t]++, dn[lca]--;
	}

	inline int DFS(int x, int la) {
		vis[x] = 1;
		for(auto u : to[x]) {
			if(u == la || vis[u]) continue;
			if(DFS(u, x)) return 1;
			up[x] += up[u], dn[x] += dn[u];
		} return up[x] && dn[x];
	}
}G;

//}}}

//{{{ Tarjan

struct UFS{
	int fa[MAXN];

	inline void init(int n) { for(int i = 1; i <= n; i++) fa[i] = i; }
	inline int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
	inline void Merge(int u, int v) { fa[find(u)] = find(v); }
}ufs;

struct Edge {
	int u, v;

	Edge() {}
	Edge(int u, int v):u(u), v(v) {}
}E[MAXN];

int tim;
int dfn[MAXN];
int low[MAXN];
int col[MAXN];

inline void Tarjan(int x, int la) {
	dfn[x] = low[x] = ++tim;
	for(auto u : to[x]) {
		if(u == la) { la = 0; continue; }
		if(!dfn[u]) Tarjan(u, x);
		chkmin(low[x], dfn[u]);
	}
}

inline void Col(int x) {
	if(col[x]) return ; col[x] = N;
	for(auto u : to[x]) Col(u);
}

inline void build(int n, int m) {
	for(int i = 1; i <= n; i++) to[i].clear();
	for(int i = 1; i <= m; i++) {
		int u = E[i].u, v = E[i].v;
		if(dfn[u] > dfn[v]) swap(u, v);
		if(dfn[u] >= low[v]) to[u].push_back(v), to[v].push_back(u);
	}
	for(int i = 1; i <= n; i++) if(!col[i]) ++N, Col(i);
	for(int i = 1; i <= m; i++) {
		int u = col[E[i].u], v = col[E[i].v];
		if(ufs.find(u) != ufs.find(v))
			ufs.Merge(u, v), G.AddEdge(u, v);
	}
}

//}}}

int main() {
#ifdef LOCAL
	FILE("");
#endif
	int n = ri, m = ri, q = ri;
	for(int i = 1; i <= m; i++) {
		int u = ri, v = ri;
		to[u].push_back(v);
		to[v].push_back(u);
		E[i] = Edge(u, v);
	}
	for(int i = 1; i <= n; i++) if(!dfn[i]) Tarjan(i, i);
	ufs.init(n), build(n, m);
	for(int i = 1; i <= N; i++) if(ufs.find(i) == i) G.dfs(i, 0);
	for(int i = 1; i <= q; i++) {
		int s = col[ri], t = col[ri];
		if(ufs.find(s) != ufs.find(t))
			return puts("No"), 0;
		G.Modify(s, t);
	} int res = 0;
	for(int i = 1; i <= N; i++) if(ufs.find(i) == i) res |= G.DFS(i, 0);
	puts(res ? "No" : "Yes");
	return 0;
}


/********************************************************************************

	Code by a weak man who named CYJian, and he hopes the code can get more points.

	Algorithm:

 ********************************************************************************/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//{{{ FAST IO AND SOME FUNCTIONS
const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;

#define ge (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
#define ri read_int()
#define rl read_ll()
#define ra read_alpha()
#define FILE(s) freopen(s"in", "r", stdin), freopen(s"out", "w", stdout)

template<typename T>
inline void read(T &x) {
	char ch, t = 0; x = 0;
	while(!isdigit(ch = ge)) t |= ch == '-';
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = ge;
	x = t ? -x : x;
}
inline char read_alpha() { char c = ge; while(!isalpha(c) && c != EOF) c = ge; return c; }
inline int read_int() { int x; return read(x), x; }
inline ll read_ll() { ll x; return read(x), x; }

template<typename T> inline void chkmin(T&a, T b) { a = a < b ? a : b; }
template<typename T> inline void chkmax(T&a, T b) { a = a > b ? a : b; }
//}}}

const int MAXN = 200010;

int N;
vector<int>to[MAXN];

//{{{ Graph

struct Graph {
	vector<int>to[MAXN];
	int fa[MAXN][20];
	int dep[MAXN];
	int up[MAXN];
	int dn[MAXN];

	inline void AddEdge(int u, int v) { to[u].push_back(v), to[v].push_back(u); }

	inline void dfs(int x, int la) {
		fa[x][0] = la, dep[x] = dep[la] + 1;
		for(int i = 1; i < 20; i++)
			fa[x][i] = fa[fa[x][i - 1]][i - 1];
		for(auto u : to[x]) {
			if(u == la) continue;
			dfs(u, x);
		}
	}

	inline int LCA(int x, int y) {
		if(dep[x] < dep[y]) swap(x, y);
		int k = dep[x] - dep[y];
		for(int i = 0; i < 20; i++)
			if(k & (1 << i)) x = fa[x][i];
		if(x == y) return x;
		for(int i = 19; ~i; --i)
			if(fa[x][i] != fa[y][i])
				x = fa[x][i], y = fa[y][i];
		return fa[x][0];
	}

	inline void Modify(int s, int t) {
		int lca = LCA(s, t);
		up[s]++, up[lca]--;
		dn[t]++, dn[lca]--;
	}

	inline int DFS(int x, int la) {
		for(auto u : to[x]) {
			if(u == la) continue;
			if(DFS(u, x)) return 1;
			up[x] += up[u], dn[x] += dn[u];
		} return up[x] && dn[x];
	}
}G;

//}}}

//{{{ Tarjan

struct UFS{
	int fa[MAXN];

	inline void init(int n) { for(int i = 1; i <= n; i++) fa[i] = i; }
	inline int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
	inline void Merge(int u, int v) { fa[find(u)] = find(v); }
}ufs;

struct Edge {
	int u, v;

	Edge() {}
	Edge(int u, int v):u(u), v(v) {}
}E[MAXN];

int tim;
int dfn[MAXN];
int low[MAXN];
int col[MAXN];

inline void Tarjan(int x, int la) {
	dfn[x] = low[x] = ++tim;
	for(auto u : to[x]) {
		if(u == la) { la = 0; continue; }
		if(!dfn[u]) Tarjan(u, x);
		chkmin(low[x], dfn[u]);
	}
}

inline void Col(int x) {
	if(col[x]) return ; col[x] = N;
	for(auto u : to[x]) Col(u);
}

inline void build(int n, int m) {
	for(int i = 1; i <= n; i++) to[i].clear();
	for(int i = 1; i <= m; i++) {
		int u = E[i].u, v = E[i].v;
		if(dfn[u] > dfn[v]) swap(u, v);
		if(dfn[u] >= low[v]) to[u].push_back(v), to[v].push_back(u);
	}
	for(int i = 1; i <= n; i++) if(!col[i]) ++N, Col(i);
	for(int i = 1; i <= m; i++) {
		int u = col[E[i].u], v = col[E[i].v];
		if(ufs.find(u) != ufs.find(v))
			ufs.Merge(u, v), G.AddEdge(u, v);
	}
}

//}}}

int main() {
#ifdef LOCAL
	FILE("");
#endif
	int n = ri, m = ri, q = ri;
	for(int i = 1; i <= m; i++) {
		int u = ri, v = ri;
		to[u].push_back(v);
		to[v].push_back(u);
		E[i] = Edge(u, v);
	}
	for(int i = 1; i <= n; i++) if(!dfn[i]) Tarjan(i, i);
	ufs.init(n), build(n, m);
	for(int i = 1; i <= N; i++) if(ufs.find(i) == i) G.dfs(i, 0);
	for(int i = 1; i <= q; i++) {
		int s = col[ri], t = col[ri];
		if(ufs.find(s) != ufs.find(t))
			return puts("No"), 0;
		G.Modify(s, t);
	} int res = 0;
	for(int i = 1; i <= N; i++) if(ufs.find(i) == i) res |= G.DFS(i, 0);
	puts(res ? "No" : "Yes");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define pb push_back
const int N=1e6+10;

int gi() {
	int x=0,o=1;char ch=getchar();
	while(!isdigit(ch)&&ch!='-') ch=getchar();
	if(ch=='-') o=-1,ch=getchar();
	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	return x*o;
}

int n,m,q,to[N],nxt[N],tt=1,st[N],tp,scc,bel[N],h[N],dfn[N],low[N],tim,id[N],up[N],dn[N],fa[N],son[N],siz[N],dep[N],top[N];
vi E[N];

void adde(int u,int v) {
	to[++tt]=v,nxt[tt]=h[u],h[u]=tt;
	to[++tt]=u,nxt[tt]=h[v],h[v]=tt;
}

void tarjan(int u,int fe) {
	dfn[u]=low[u]=++tim;
	st[++tp]=u;
	for(int i=h[u],v;v=to[i],i;i=nxt[i])
		if(i^fe^1) {
			if(!dfn[v]) tarjan(v,i),low[u]=min(low[u],low[v]);
			else low[u]=min(low[u],dfn[v]);
		}
	if(low[u]==dfn[u]) {
		int v;++scc;
		do v=st[tp--],bel[v]=scc; while(u!=v);
	}
}

void dfs1(int u,int ff,int x) {
	fa[u]=ff,siz[u]=1,dep[u]=dep[ff]+1,id[u]=x;
	for(auto v:E[u])
		if(v^ff) {
			dfs1(v,u,x),siz[u]+=siz[v];
			if(siz[son[u]]<siz[v]) son[u]=v;
		}
}

void dfs2(int u,int tp) {
	top[u]=tp; if(son[u]) dfs2(son[u],tp);
	for(auto v:E[u])
		if(v!=fa[u]&&v!=son[u]) dfs2(v,v);
}

int lca(int u,int v) {
	while(top[u]!=top[v]) {
		if(dep[top[u]]<dep[top[v]]) swap(u,v);
		u=fa[top[u]];
	}
	return dep[u]<dep[v]?u:v;
}

void dfs3(int u) {
	dep[u]=-1;
	for(auto v:E[u])
		if(v^fa[u]) dfs3(v),up[u]+=up[v],dn[u]+=dn[v];
	if(up[u]&&dn[u]) cout<<"No",exit(0);
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
#endif
	cin>>n>>m>>q;
	for(int i=1;i<=m;i++) adde(gi(),gi());
	for(int i=1;i<=n;i++) if(!dfn[i]) tarjan(i,0);
	for(int u=1;u<=n;u++)
		for(int i=h[u],v;v=to[i],i;i=nxt[i])
			if(bel[u]<bel[v]) E[bel[u]].pb(bel[v]),E[bel[v]].pb(bel[u]);
	int tt=0;
	for(int i=1;i<=scc;i++)
		if(!dep[i]) dfs1(i,0,++tt),dfs2(i,i);
	while(q--) {
		int s=bel[gi()],t=bel[gi()];
		if(id[s]!=id[t]) return cout<<"No",0;
		else if(s==t) continue;
		else {
			int p=lca(s,t);
			++up[s],--up[p],++dn[t],--dn[p];
		}
	}
	for(int i=1;i<=scc;i++)
		if(dep[i]>=0) dfs3(i);
	cout<<"Yes";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define pb push_back
const int N=1e6+10;

int gi() {
	int x=0,o=1;char ch=getchar();
	while(!isdigit(ch)&&ch!='-') ch=getchar();
	if(ch=='-') o=-1,ch=getchar();
	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	return x*o;
}

int n,m,q,to[N],nxt[N],tt=1,st[N],tp,scc,bel[N],h[N],dfn[N],low[N],tim,id[N],up[N],dn[N],fa[N],son[N],siz[N],dep[N],top[N];
vi E[N];

void adde(int u,int v) {
	to[++tt]=v,nxt[tt]=h[u],h[u]=tt;
	to[++tt]=u,nxt[tt]=h[v],h[v]=tt;
}

void tarjan(int u,int fe) {
	dfn[u]=low[u]=++tim;
	st[++tp]=u;
	for(int i=h[u],v;v=to[i],i;i=nxt[i])
		if(i^fe^1) {
			if(!dfn[v]) tarjan(v,i),low[u]=min(low[u],low[v]);
			else low[u]=min(low[u],dfn[v]);
		}
	if(low[u]==dfn[u]) {
		int v;++scc;
		do v=st[tp--],bel[v]=scc; while(u!=v);
	}
}

void dfs1(int u,int ff,int x) {
	fa[u]=ff,siz[u]=1,dep[u]=dep[ff]+1,id[u]=x;
	for(auto v:E[u])
		if(v^ff) {
			dfs1(v,u,x),siz[u]+=siz[v];
			if(siz[son[u]]<siz[v]) son[u]=v;
		}
}

void dfs2(int u,int tp) {
	top[u]=tp; if(son[u]) dfs2(son[u],tp);
	for(auto v:E[u])
		if(v!=fa[u]&&v!=son[u]) dfs2(v,v);
}

int lca(int u,int v) {
	while(top[u]!=top[v]) {
		if(dep[top[u]]<dep[top[v]]) swap(u,v);
		u=fa[top[u]];
	}
	return dep[u]<dep[v]?u:v;
}

void dfs3(int u) {
	dep[u]=-1;
	for(auto v:E[u])
		if(v^fa[u]) dfs3(v),up[u]+=up[v],dn[u]+=dn[v];
	if(up[u]&&dn[u]) cout<<"No",exit(0);
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
#endif
	cin>>n>>m>>q;
	for(int i=1;i<=m;i++) adde(gi(),gi());
	for(int i=1;i<=n;i++) if(!dfn[i]) tarjan(i,0);
	for(int u=1;u<=n;u++)
		for(int i=h[u],v;v=to[i],i;i=nxt[i])
			if(bel[u]!=bel[v]) E[bel[u]].pb(bel[v]),E[bel[v]].pb(bel[u]);
	int tt=0;
	for(int i=1;i<=scc;i++)
		if(!dep[i]) dfs1(i,0,++tt),dfs2(i,0);
	while(q--) {
		int s=bel[gi()],t=bel[gi()];
		if(id[s]!=id[t]) return cout<<"No",0;
		else if(s==t) continue;
		else {
			int p=lca(s,t);
			++up[s],--up[p],++dn[t],--dn[p];
		}
	}
	for(int i=1;i<=scc;i++)
		if(dep[i]>=0) dfs3(i);
	cout<<"Yes";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define pb push_back
const int N=1e6+10;

int gi() {
	int x=0,o=1;char ch=getchar();
	while(!isdigit(ch)&&ch!='-') ch=getchar();
	if(ch=='-') o=-1,ch=getchar();
	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	return x*o;
}

int n,m,q,to[N],nxt[N],tt=1,st[N],tp,scc,bel[N],h[N],dfn[N],low[N],tim,id[N],up[N],dn[N],fa[N],son[N],siz[N],dep[N],top[N];
vi E[N];

void adde(int u,int v) {
	to[++tt]=v,nxt[tt]=h[u],h[u]=tt;
	to[++tt]=u,nxt[tt]=h[v],h[v]=tt;
}

void tarjan(int u,int fe) {
	dfn[u]=low[u]=++tim;
	st[++tp]=u;
	for(int i=h[u],v;v=to[i],i;i=nxt[i])
		if(i^fe^1) {
			if(!dfn[v]) tarjan(v,i),low[u]=min(low[u],low[v]);
			else low[u]=min(low[u],dfn[v]);
		}
	if(low[u]==dfn[u]) {
		int v;++scc;
		do v=st[tp--],bel[v]=scc; while(u!=v);
	}
}

void dfs1(int u,int ff,int x) {
	fa[u]=ff,siz[u]=1,dep[u]=dep[ff]+1,id[u]=x;
	for(auto v:E[u])
		if(v^ff) {
			dfs1(v,u,x),siz[u]+=siz[v];
			if(siz[son[u]]<siz[v]) son[u]=v;
		}
}

void dfs2(int u,int tp) {
	top[u]=tp; if(son[u]) dfs2(son[u],tp);
	for(auto v:E[u])
		if(v!=fa[u]&&v!=son[u]) dfs2(v,v);
}

int lca(int u,int v) {
	while(top[u]!=top[v]) {
		if(dep[top[u]]<dep[top[v]]) swap(u,v);
		u=fa[top[u]];
	}
	return dep[u]<dep[v]?u:v;
}

void dfs3(int u) {
	dep[u]=-1;
	for(auto v:E[u])
		if(v^fa[u]) dfs3(v),up[u]+=up[v],dn[u]+=dn[v];
	if(up[u]&&dn[u]) cout<<"No",exit(0);
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
#endif
	cin>>n>>m>>q;
	for(int i=1;i<=m;i++) adde(gi(),gi());
	for(int i=1;i<=n;i++) if(!dfn[i]) tarjan(i,0);
	for(int u=1;u<=n;u++)
		for(int i=h[u],v;v=to[i],i;i=nxt[i])
			if(bel[u]!=bel[v]) E[bel[u]].pb(bel[v]),E[bel[v]].pb(bel[u]);
	int tt=0;
	for(int i=1;i<=scc;i++)
		if(!dep[i]) dfs1(i,0,++tt),dfs2(i,i);
	while(q--) {
		int s=bel[gi()],t=bel[gi()];
		if(id[s]!=id[t]) return cout<<"No",0;
		else if(s==t) continue;
		else {
			int p=lca(s,t);
			++up[s],--up[p],++dn[t],--dn[p];
		}
	}
	for(int i=1;i<=scc;i++)
		if(dep[i]>=0) dfs3(i);
	cout<<"Yes";
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;

int n, m, q, curr, sz, tag;
int num[N];
int low[N];
int dead[N];
int team[N];
int jump[N][20];
int depth[N];
int up[N];
int direct[N];
int lab[N];
int tree[N];
int vsted[N];
multiset < int > adj[N];
set < int > gra[N];
stack < int > current;

void dfs(int u, int p = 0){
  current.push(u);
  num[u] = low[u] = ++curr;
  int parent = 1;
  for(int v : adj[u]){
    if(dead[v] == 1){
      continue;
    }
    if(v == p && parent == 1){
      parent = 0;
      continue;
    }
    if(num[v] == 0){
      dfs(v, u);
      low[u] = min(low[u], low[v]);
    }
    else{
      low[u] = min(low[u], num[v]);
    }
  }
  if(low[u] >= num[u]){
    ++sz;
    while(true){
      int v = current.top();
      dead[v] = 1;
      team[v] = sz;
      current.pop();
      if(v == u){
        break;
      }
    }
  }
}

void vst(int u, int p){
  tree[u] = tag;
  vsted[u] = 1;
  jump[u][0] = p;
  for(int i = 1; i < 20; ++i){
    if(jump[u][i - 1] == 0){
      break;
    }
    jump[u][i] = jump[jump[u][i - 1]][i - 1];
  }
  for(int v : gra[u]){
    if(v == p){
      continue;
    }
    depth[v] = depth[u] + 1;
    vst(v, u);
  }
}

int lca(int u, int v){
  if(depth[u] < depth[v]){
    swap(u, v);
  }
  for(int i = 19; i >= 0; --i){
    if(jump[u][i] == 0){
      continue;
    }
    if(depth[jump[u][i]] >= depth[v]){
      u = jump[u][i];
    }
  }
  if(u == v){
    return u;
  }
  for(int i = 19; i >= 0; --i){
    if(jump[u][i] != jump[v][i]){
      u = jump[u][i];
      v = jump[v][i];
    }
  }
  return jump[u][0];
}

int fin(int u){
  if(lab[u] == u){
    return u;
  }
  return lab[u] = fin(lab[u]);
}

void join(int u, int v){
  lab[u] = v;
}

void work(int u, int p, int dir){
  while(u != p){
    if(direct[u] != -1){
      if(direct[u] != dir){
        puts("No");
        exit(0);
      }
      else{
        if(fin(u) == fin(p)){
          return;
        }
        u = fin(u);
      }
    }
    else{
      direct[u] = dir;
      join(u, jump[u][0]);
      u = jump[u][0];
    }
  }
}

int main(){
  #ifdef pts
    freopen("1.inp", "r", stdin);
  //  freopen("1.out", "w", stdout);
  #endif
  memset(direct, -1, sizeof direct);
  scanf("%d%d%d", &n, &m, &q);
  for(int i = 1; i <= m; ++i){
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].insert(v);
    adj[v].insert(u);
  }
  for(int i = 1; i <= n; ++i){
    lab[i] = i;
    if(num[i] == 0){
      dfs(i);
    }
  }
  for(int u = 1; u <= n; ++u){
    for(int v : adj[u]){
      gra[team[u]].insert(team[v]);
    }
  }
  for(int i = 1; i <= sz; ++i){
    if(!vsted[i]){
      ++tag;
      vst(i, 0);
    }
  }
  for(int i = 1; i <= q; ++i){
    int u, v, p;
    scanf("%d%d", &u, &v);
    u = team[u];
    v = team[v];
    if(u == v){
      continue;
    }
    if(tree[u] != tree[v]){
      cout << "No";
      return 0;
    }
    p = lca(u, v);
    work(u, p, 0);
    work(v, p, 1);
  }
  cout << "Yes";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;

int n, m, q, curr, sz, tag;
int num[N];
int low[N];
int dead[N];
int team[N];
int jump[N][20];
int depth[N];
int up[N];
int direct[N];
int lab[N];
int tree[N];
int vsted[N];
vector < int > adj[N];
set < int > gra[N];
stack < int > current;

void dfs(int u, int p = 0){
  current.push(u);
  num[u] = low[u] = ++curr;
  int parent = 1;
  for(int v : adj[u]){
    if(dead[v] == 1){
      continue;
    }
    if(v == p && parent == 1){
      parent = 0;
      continue;
    }
    if(num[v] == 0){
      dfs(v, u);
      low[u] = min(low[u], low[v]);
    }
    else{
      low[u] = min(low[u], num[v]);
    }
  }
  if(low[u] >= num[u]){
    ++sz;
    while(true){
      int v = current.top();
      dead[v] = 1;
      team[v] = sz;
      current.pop();
      if(v == u){
        break;
      }
    }
  }
}

void vst(int u, int p){
  tree[u] = tag;
  vsted[u] = 1;
  jump[u][0] = p;
  for(int i = 1; i < 20; ++i){
    if(jump[u][i - 1] == 0){
      break;
    }
    jump[u][i] = jump[jump[u][i - 1]][i - 1];
  }
  for(int v : gra[u]){
    if(v == p){
      continue;
    }
    depth[v] = depth[u] + 1;
    vst(v, u);
  }
}

int lca(int u, int v){
  if(depth[u] < depth[v]){
    swap(u, v);
  }
  for(int i = 19; i >= 0; --i){
    if(jump[u][i] == 0){
      continue;
    }
    if(depth[jump[u][i]] >= depth[v]){
      u = jump[u][i];
    }
  }
  if(u == v){
    return u;
  }
  for(int i = 19; i >= 0; --i){
    if(jump[u][i] != jump[v][i]){
      u = jump[u][i];
      v = jump[v][i];
    }
  }
  return jump[u][0];
}

int fin(int u){
  if(lab[u] == u){
    return u;
  }
  return lab[u] = fin(lab[u]);
}

void join(int u, int v){
  lab[u] = v;
}

void work(int u, int p, int dir){
  while(u != p){
    if(direct[u] != -1){
      if(direct[u] != dir){
        puts("No");
        exit(0);
      }
      else{
        if(fin(u) == fin(p)){
          return;
        }
        u = fin(u);
      }
    }
    else{
      direct[u] = dir;
      join(u, jump[u][0]);
      u = jump[u][0];
    }
  }
}

int main(){
  #ifdef pts
    freopen("1.inp", "r", stdin);
  //  freopen("1.out", "w", stdout);
  #endif
  memset(direct, -1, sizeof direct);
  scanf("%d%d%d", &n, &m, &q);
  for(int i = 1; i <= m; ++i){
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for(int i = 1; i <= n; ++i){
    lab[i] = i;
    if(num[i] == 0){
      dfs(i);
    }
  }
  for(int u = 1; u <= n; ++u){
    for(int v : adj[u]){
      if(team[u] == team[v]){
        continue;
      }
      gra[team[u]].insert(team[v]);
    }
  }
  for(int i = 1; i <= sz; ++i){
    if(!vsted[i]){
      ++tag;
      vst(i, 0);
    }
  }
  for(int i = 1; i <= q; ++i){
    int u, v, p;
    scanf("%d%d", &u, &v);
    u = team[u];
    v = team[v];
    if(u == v){
      continue;
    }
    if(tree[u] != tree[v]){
      cout << "No";
      return 0;
    }
    p = lca(u, v);
    work(u, p, 0);
    work(v, p, 1);
  }
  cout << "Yes";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 10;

int n, m, q, curr, sz, tag;
int num[N];
int low[N];
int dead[N];
int team[N];
int jump[N][20];
int depth[N];
int up[N];
int direct[N];
int lab[N];
int tree[N];
int vsted[N];
vector < int > adj[N];
set < int > gra[N];
stack < int > current;

void dfs(int u, int p = 0){
  current.push(u);
  num[u] = low[u] = ++curr;
  int parent = 1;
  for(int v : adj[u]){
    if(dead[v] == 1){
      continue;
    }
    if(v == p && parent == 1){
      parent = 0;
      continue;
    }
    if(num[v] == 0){
      dfs(v, u);
      low[u] = min(low[u], low[v]);
    }
    else{
      low[u] = min(low[u], num[v]);
    }
  }
  if(low[u] >= num[u]){
    ++sz;
    while(true){
      int v = current.top();
      dead[v] = 1;
      team[v] = sz;
      current.pop();
      if(v == u){
        break;
      }
    }
  }
}

void vst(int u, int p){
  tree[u] = tag;
  vsted[u] = 1;
  jump[u][0] = p;
  for(int i = 1; i < 20; ++i){
    if(jump[u][i - 1] == 0){
      break;
    }
    jump[u][i] = jump[jump[u][i - 1]][i - 1];
  }
  for(int v : gra[u]){
    if(v == p){
      continue;
    }
    depth[v] = depth[u] + 1;
    vst(v, u);
  }
}

int lca(int u, int v){
  if(depth[u] < depth[v]){
    swap(u, v);
  }
  for(int i = 19; i >= 0; --i){
    if(jump[u][i] == 0){
      continue;
    }
    if(depth[jump[u][i]] >= depth[v]){
      u = jump[u][i];
    }
  }
  if(u == v){
    return u;
  }
  for(int i = 19; i >= 0; --i){
    if(jump[u][i] != jump[v][i]){
      u = jump[u][i];
      v = jump[v][i];
    }
  }
  return jump[u][0];
}

int fin(int u){
  if(lab[u] == u){
    return u;
  }
  return lab[u] = fin(lab[u]);
}

void join(int u, int v){
  lab[u] = v;
}

void work(int u, int p, int dir){
  while(u != p){
    if(direct[u] != -1){
      if(direct[u] != dir){
        puts("No");
        exit(0);
      }
      else{
        if(fin(u) == fin(p)){
          return;
        }
        u = fin(u);
      }
    }
    else{
      direct[u] = dir;
      join(u, jump[u][0]);
      u = jump[u][0];
    }
  }
}

int main(){
  #ifdef pts
    freopen("1.inp", "r", stdin);
  //  freopen("1.out", "w", stdout);
  #endif
  memset(direct, -1, sizeof direct);
  scanf("%d%d%d", &n, &m, &q);
  for(int i = 1; i <= m; ++i){
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for(int i = 1; i <= n; ++i){
    lab[i] = i;
    if(num[i] == 0){
      dfs(i);
    }
  }
  for(int u = 1; u <= n; ++u){
    for(int v : adj[u]){
      if(team[u] == team[v]){
        continue;
      }
      gra[team[u]].insert(team[v]);
    }
  }
  return 0;
  for(int i = 1; i <= sz; ++i){
    if(!vsted[i]){
      ++tag;
      vst(i, 0);
    }
  }
  for(int i = 1; i <= q; ++i){
    int u, v, p;
    scanf("%d%d", &u, &v);
    u = team[u];
    v = team[v];
    if(u == v){
      continue;
    }
    if(tree[u] != tree[v]){
      cout << "No";
      return 0;
    }
    p = lca(u, v);
    work(u, p, 0);
    work(v, p, 1);
  }
  cout << "Yes";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 10;

int n, m, q, curr, sz, tag;
int num[N];
int low[N];
int dead[N];
int team[N];
int jump[N][20];
int depth[N];
int up[N];
int direct[N];
int lab[N];
int tree[N];
int vsted[N];
vector < int > adj[N];
set < int > gra[N];
stack < int > current;

void dfs(int u, int p = 0){
  current.push(u);
  num[u] = low[u] = ++curr;
  int parent = 1;
  for(int v : adj[u]){
    if(dead[v] == 1){
      continue;
    }
    if(v == p && parent == 1){
      parent = 0;
      continue;
    }
    if(num[v] == 0){
      dfs(v, u);
      low[u] = min(low[u], low[v]);
    }
    else{
      low[u] = min(low[u], num[v]);
    }
  }
  if(low[u] >= num[u]){
    ++sz;
    while(true){
      int v = current.top();
      dead[v] = 1;
      team[v] = sz;
      current.pop();
      if(v == u){
        break;
      }
    }
  }
}

void vst(int u, int p){
  tree[u] = tag;
  vsted[u] = 1;
  jump[u][0] = p;
  for(int i = 1; i < 20; ++i){
    if(jump[u][i - 1] == 0){
      break;
    }
    jump[u][i] = jump[jump[u][i - 1]][i - 1];
  }
  for(int v : gra[u]){
    if(v == p){
      continue;
    }
    depth[v] = depth[u] + 1;
    vst(v, u);
  }
}

int lca(int u, int v){
  if(depth[u] < depth[v]){
    swap(u, v);
  }
  for(int i = 19; i >= 0; --i){
    if(jump[u][i] == 0){
      continue;
    }
    if(depth[jump[u][i]] >= depth[v]){
      u = jump[u][i];
    }
  }
  if(u == v){
    return u;
  }
  for(int i = 19; i >= 0; --i){
    if(jump[u][i] != jump[v][i]){
      u = jump[u][i];
      v = jump[v][i];
    }
  }
  return jump[u][0];
}

int fin(int u){
  if(lab[u] == u){
    return u;
  }
  return lab[u] = fin(lab[u]);
}

void join(int u, int v){
  lab[u] = v;
}

void work(int u, int p, int dir){
  while(u != p){
    if(direct[u] != -1){
      if(direct[u] != dir){
        puts("No");
        exit(0);
      }
      else{
        if(fin(u) == fin(p)){
          return;
        }
        u = fin(u);
      }
    }
    else{
      direct[u] = dir;
      join(u, jump[u][0]);
      u = jump[u][0];
    }
  }
}

int main(){
  #ifdef pts
    freopen("1.inp", "r", stdin);
  //  freopen("1.out", "w", stdout);
  #endif
  memset(direct, -1, sizeof direct);
  scanf("%d%d%d", &n, &m, &q);
  for(int i = 1; i <= m; ++i){
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for(int i = 1; i <= n; ++i){
    lab[i] = i;
    if(num[i] == 0){
      dfs(i);
    }
  }
  for(int u = 1; u <= n; ++u){
    for(int v : adj[u]){
      if(team[u] == team[v]){
        continue;
      }
      gra[team[u]].insert(team[v]);
    }
  }
  for(int i = 1; i <= sz; ++i){
    if(!vsted[i]){
      ++tag;
      vst(i, 0);
    }
  }
  for(int i = 1; i <= q; ++i){
    int u, v, p;
    scanf("%d%d", &u, &v);
    u = team[u];
    v = team[v];
    if(u == v){
      continue;
    }
    if(tree[u] != tree[v]){
      cout << "No";
      return 0;
    }
    p = lca(u, v);
    work(u, p, 0);
    work(v, p, 1);
  }
  cout << "Yes";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pll pair <ll , ll>

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair

#define X first
#define Y second

#define LB(x) (x & (-x))
#define BIT(a,b) ((ll)(a&(1<<b))==0 ? false : true)

const ll MAXN=2e5+10;
const ll MAX_LOG=30;
const ll INF=1e12+10;

vector < pair <ll , pll> > h[MAXN];

vector <ll> vertex[MAXN];
vector <ll> floor_g[MAXN];
vector <ll> child[MAXN];

vector <ll> ver;

pll seg[MAXN];

ll par[MAXN][MAX_LOG];

ll state[MAXN][2];

ll dp[MAXN];
ll floor_v[MAXN];
ll back_edge[MAXN];
ll len[MAXN];
ll head[MAXN];

bool check[MAXN];

ll cnt=0,maxf=0;

bool is_par(ll v , ll u)
{
    if (seg[v].X<=seg[u].X && seg[v].Y>=seg[u].Y)
    {
        return true;
    }

    return false;
}

ll lca(ll v , ll u)
{
    if (is_par(v , u))
    {
        return v;
    }

    if (is_par(u , v))
    {
        return u;
    }

    for(ll i=MAX_LOG-1;i>=0;i--)
    {
        if (!is_par(par[v][i] , u))
        {
            v=par[v][i];
        }
    }

    return par[v][0];
}

void fill_dp(ll f)
{
    for(ll i=0;i<floor_g[f].size();i++)
    {
        ll v=floor_g[f][i];

        for (ll j=0;j<h[v].size();j++)
        {
            state[v][h[v][j].X]=min(state[v][h[v][j].X] , floor_v[lca(h[v][j].Y.X , h[v][j].Y.Y)]);
        }

        dp[v]=back_edge[v];

        for(ll j=0;j<child[v].size();j++)
        {
            dp[v]=min(dp[v] , dp[child[v][j]]);

            state[v][0]=min(state[v][0] , state[child[v][j]][0]);
            state[v][1]=min(state[v][1] , state[child[v][j]][1]);
        }

        //cout<<v<<" "<<dp[v]<<" "<<state[v][0]<<" "<<state[v][1]<<endl;

        if (dp[v]>=f)
        {
            if (state[v][0]<f && state[v][1]<f)
            {
                cout<<"No";
                exit(0);
            }
        }
    }
}

void dfs(ll v , ll f)
{
    seg[v].X=cnt++;

    back_edge[v]=f;

    check[v]=true;

    ver.pb(v);

    if (f>maxf)
    {
        maxf=f;
        floor_g[f].clear();
    }

    floor_g[f].pb(v);
    floor_v[v]=f;

    bool t=false;

    for(ll i=0;i<vertex[v].size();i++)
    {
        if (!check[vertex[v][i]])
        {
            par[vertex[v][i]][0]=v;

            dfs(vertex[v][i] , f+1);

            child[v].pb(vertex[v][i]);
        }
        else
        {
            if (!t && vertex[v][i]==par[v][0])
            {
                t=true;
                continue;
            }

            back_edge[v]=min(back_edge[v] , floor_v[vertex[v][i]]);
        }
    }

    seg[v].Y=cnt++;
}

void ok(ll v)
{
    maxf=-1;
    cnt=0;

    ver.clear();

    dfs(v , 0);

    par[v][0]=v;

    for(ll i=1;i<MAX_LOG;i++)
    {
        for(ll j=0;j<ver.size();j++)
        {
            par[ver[j]][i]=par[par[ver[j]][i-1]][i-1];
        }
    }

    for(ll i=maxf;i>=0;i--)
    {
        fill_dp(i);
    }
}

void update(ll v)
{
    if (head[head[v]]!=head[v])
    {
        update(head[v]);
    }

    head[v]=head[head[v]];
}

void dsu(ll v , ll u)
{
    update(v);
    update(u);

    if (head[v]==head[u])
    {
        return;
    }

    if (len[head[v]]<len[head[u]])
    {
        head[head[v]]=head[u];
        len[head[u]]+=len[head[v]];
    }
    else
    {
        head[head[u]]=head[v];
        len[head[v]]+=len[head[u]];
    }
}

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);

    ll n,m,q;
    cin>>n>>m>>q;

    for(ll i=1;i<=n;i++)
    {
        head[i]=i;
        len[i]=1;
    }

    for(ll i=0;i<m;i++)
    {
        ll v,u;
        cin>>v>>u;

        vertex[v].pb(u);
        vertex[u].pb(v);

        dsu(v , u);
    }

    for(ll i=1;i<=n;i++)
    {
        update(i);
    }

    for(ll i=0;i<q;i++)
    {
        ll v,u;
        cin>>v>>u;

        h[v].pb(mp(0 , mp(v , u)));
        h[u].pb(mp(1 , mp(v , u)));

        if (head[v]!=head[u])
        {
            cout<<"No";
            return 0;
        }
    }

    for(ll i=0;i<MAXN;i++)
    {
        state[i][0]=INF;
        state[i][1]=INF;
    }

    for(ll i=1;i<=n;i++)
    {
        if (!check[i])
        {
            ok(i);
        }
    }

    cout<<"Yes";
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pll pair <ll , ll>

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair

#define X first
#define Y second

#define LB(x) (x & (-x))
#define BIT(a,b) ((ll)(a&(1<<b))==0 ? false : true)

const ll MAXN=2e5+10;
const ll INF=1e12+10;

set <pll> e[MAXN];

vector <pll> h[MAXN];

vector <ll> vertex[MAXN];
vector <ll> floor_g[MAXN];
vector <ll> child[MAXN];

ll dp[MAXN];
ll head[MAXN];
ll len[MAXN];
ll floor_v[MAXN];
ll back_edge[MAXN];
ll par[MAXN];

bool check[MAXN];

ll maxf=0;

void dsu(ll v , ll u)
{
    if ((ll)(e[v].size())>(ll)(e[u].size()))
    {
        while (!e[u].empty())
        {
            set <pll> :: iterator i=e[u].begin();

            pll a=(*i);
            a.X=1-a.X;

            if (e[v].find(a)!=e[v].end())
            {
                e[v].erase(a);
            }
            else
            {
                e[v].insert(*i);
            }

            e[u].erase(i);
        }
    }
    else
    {
        while (!e[v].empty())
        {
            set <pll> :: iterator i=e[v].begin();

            pll a=(*i);
            a.X=1-a.X;

            if (e[u].find(a)!=e[u].end())
            {
                e[u].erase(a);
            }
            else
            {
                e[u].insert(*i);
            }

            e[v].erase(i);
        }

        e[v].swap(e[u]);
    }
}

void fill_dp(ll f)
{
    for(ll i=0;i<floor_g[f].size();i++)
    {
        ll v=floor_g[f][i];

        for (ll j=0;j<h[v].size();j++)
        {
            e[v].insert(h[v][j]);
        }

        dp[v]=back_edge[v];

        for(ll j=0;j<child[v].size();j++)
        {
            dp[v]=min(dp[v] , dp[child[v][j]]);

            dsu(v , child[v][j]);
        }

        if (dp[v]>=f)
        {
            //cout<<":D "<<v<<" "<<dp[v]<<" "<<back_edge[v]<<" "<<e[v].size()<<" ";
            ll c=0;

            set <pll> :: iterator a=upper_bound(e[v].begin() , e[v].end() , mp((ll)0 , (ll)(-1)));
            set <pll> :: iterator b=upper_bound(e[v].begin() , e[v].end() , mp((ll)1 , (ll)(-1)));

            //cout<<a->X<<" "<<a->Y<<" :P "<<b->X<<" "<<b->Y<<endl;

            if (a!=e[v].end() && (a->X)==0)
            {
                c++;
            }

            if (b!=e[v].end() && (b->X)==1)
            {
                c++;
            }

            if (c==2)
            {
                cout<<"No";
                exit(0);
            }
        }
    }
}

void dfs(ll v , ll f)
{
    back_edge[v]=f;

    check[v]=true;

    if (f>=maxf)
    {
        maxf=f;
        floor_g[f].clear();
    }

    floor_g[f].pb(v);
    floor_v[v]=f;

    bool t=false;

    for(ll i=0;i<vertex[v].size();i++)
    {
        if (!check[vertex[v][i]])
        {
            par[vertex[v][i]]=v;

            dfs(vertex[v][i] , f+1);

            child[v].pb(vertex[v][i]);
        }
        else
        {
            if (!t && vertex[v][i]==par[v])
            {
                t=true;
                continue;
            }

            back_edge[v]=min(back_edge[v] , floor_v[vertex[v][i]]);
        }
    }
}

void ok(ll v)
{
    maxf=0;

    dfs(v , 0);

    for(ll i=maxf;i>=0;i--)
    {
        fill_dp(i);
    }
}

void update(ll v)
{
    if (head[head[v]]!=head[v])
    {
        update(head[v]);
    }

    head[v]=head[head[v]];
}

void pre_dsu(ll v , ll u)
{
    update(v);
    update(u);

    if (head[v]==head[u])
    {
        return;
    }

    if (len[head[v]]<len[head[u]])
    {
        head[head[v]]=head[u];
        len[head[u]]+=len[head[v]];
    }
    else
    {
        head[head[u]]=head[v];
        len[head[v]]+=len[head[u]];
    }
}

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);

    ll n,m,q;
    cin>>n>>m>>q;

    for(ll i=1;i<=n;i++)
    {
        head[i]=i;
        len[i]=1;
    }

    for(ll i=0;i<m;i++)
    {
        ll v,u;
        cin>>v>>u;

        vertex[v].pb(u);
        vertex[u].pb(v);

        pre_dsu(v , u);
    }

    for(ll i=1;i<=n;i++)
    {
        update(i);
    }

    for(ll i=0;i<q;i++)
    {
        ll v,u;
        cin>>v>>u;

        h[v].pb(mp(0 , i));
        h[u].pb(mp(1 , i));

        if (head[v]!=head[u])
        {
            cout<<"No";
            return 0;
        }
    }

    for(ll i=1;i<=n;i++)
    {
        if (!check[i])
        {
            ok(i);
        }
    }

    cout<<"Yes";
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pll pair <ll , ll>

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair

#define X first
#define Y second

#define LB(x) (x & (-x))
#define BIT(a,b) ((ll)(a&(1<<b))==0 ? false : true)

const ll MAXN=2e5+10;
const ll MAX_LOG=30;
const ll INF=1e12+10;

vector < pair <ll , pll> > h[MAXN];

vector <ll> vertex[MAXN];
vector <ll> floor_g[MAXN];
vector <ll> child[MAXN];

vector <ll> ver;

pll seg[MAXN];

ll par[MAXN][MAX_LOG];

ll state[MAXN][2];

ll dp[MAXN];
ll floor_v[MAXN];
ll back_edge[MAXN];

bool check[MAXN];

ll cnt=0,maxf=0;

bool is_par(ll v , ll u)
{
    if (seg[v].X<=seg[u].X && seg[v].Y>=seg[u].Y)
    {
        return true;
    }

    return false;
}

ll lca(ll v , ll u)
{
    if (is_par(v , u))
    {
        return v;
    }

    if (is_par(u , v))
    {
        return u;
    }

    for(ll i=MAX_LOG-1;i>=0;i--)
    {
        if (!is_par(par[v][i] , u))
        {
            v=par[v][i];
        }
    }

    return par[v][0];
}

void fill_dp(ll f)
{
    for(ll i=0;i<floor_g[f].size();i++)
    {
        ll v=floor_g[f][i];

        for (ll j=0;j<h[v].size();j++)
        {
            ll b=h[v][j].X;

            if (state[v][b]==-1)
            {
                state[v][b]=floor_v[lca(h[v][j].Y.X , h[v][j].Y.Y)];
            }
            else
            {
                state[v][b]=min(state[v][b] , floor_v[lca(h[v][j].Y.X , h[v][j].Y.Y)]);
            }
        }

        dp[v]=back_edge[v];

        for(ll j=0;j<child[v].size();j++)
        {
            dp[v]=min(dp[v] , dp[child[v][j]]);

            if (state[v][0]==-1)
            {
                state[v][0]=state[child[v][j]][0];
            }

            if (state[v][1]==-1)
            {
                state[v][1]=state[child[v][j]][1];
            }

            if (state[child[v][j]][0]!=-1)
            {
                state[v][0]=min(state[v][0] , state[child[v][j]][0]);
            }

            if (state[child[v][j]][1]!=-1)
            {
                state[v][1]=min(state[v][1] , state[child[v][j]][1]);
            }
        }

        //cout<<v<<" "<<dp[v]<<" "<<state[v][0]<<" "<<state[v][1]<<endl;

        if (dp[v]>=f)
        {
            if (state[v][0]!=-1 && state[v][1]!=-1 && state[v][0]<f && state[v][1]<f)
            {
                cout<<"No";
                exit(0);
            }
        }
    }
}

void dfs(ll v , ll f)
{
    seg[v].X=cnt++;

    back_edge[v]=f;

    check[v]=true;

    ver.pb(v);

    if (f>maxf)
    {
        maxf=f;
        floor_g[f].clear();
    }

    floor_g[f].pb(v);
    floor_v[v]=f;

    bool t=false;

    for(ll i=0;i<vertex[v].size();i++)
    {
        if (!check[vertex[v][i]])
        {
            par[vertex[v][i]][0]=v;

            dfs(vertex[v][i] , f+1);

            child[v].pb(vertex[v][i]);
        }
        else
        {
            if (!t && vertex[v][i]==par[v][0])
            {
                t=true;
                continue;
            }

            back_edge[v]=min(back_edge[v] , floor_v[vertex[v][i]]);
        }
    }

    seg[v].Y=cnt++;
}

void ok(ll v)
{
    maxf=-1;
    cnt=0;

    ver.clear();

    dfs(v , 0);

    par[v][0]=v;

    for(ll i=1;i<MAX_LOG;i++)
    {
        for(ll j=0;j<ver.size();j++)
        {
            par[ver[j]][i]=par[par[ver[j]][i-1]][i-1];
        }
    }

    for(ll i=maxf;i>=0;i--)
    {
        fill_dp(i);
    }
}

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);

    ll n,m,q;
    cin>>n>>m>>q;

    for(ll i=0;i<m;i++)
    {
        ll v,u;
        cin>>v>>u;

        vertex[v].pb(u);
        vertex[u].pb(v);
    }

    for(ll i=0;i<q;i++)
    {
        ll v,u;
        cin>>v>>u;

        h[v].pb(mp(0 , mp(v , u)));
        h[u].pb(mp(1 , mp(v , u)));
    }

    for(ll i=0;i<MAXN;i++)
    {
        state[i][0]=-1;
        state[i][1]=-1;
    }

    for(ll i=1;i<=n;i++)
    {
        if (!check[i])
        {
            ok(i);
        }
    }

    cout<<"Yes";
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pll pair <ll , ll>

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair

#define X first
#define Y second

#define LB(x) (x & (-x))
#define BIT(a,b) ((ll)(a&(1<<b))==0 ? false : true)

const ll MAXN=2e5+10;
const ll INF=1e12+10;

set <pll> e[MAXN];

vector <pll> h[MAXN];

vector <ll> vertex[MAXN];
vector <ll> floor_g[MAXN];
vector <ll> child[MAXN];

ll dp[MAXN];
ll head[MAXN];
ll len[MAXN];
ll floor_v[MAXN];
ll back_edge[MAXN];
ll par[MAXN];

bool check[MAXN];

ll maxf=0;

void dsu(ll v , ll u)
{
    if ((ll)(e[v].size())>(ll)(e[u].size()))
    {
        while (!e[u].empty())
        {
            set <pll> :: iterator i=e[u].begin();

            pll a=(*i);
            a.X=1-a.X;

            if (e[v].find(a)!=e[v].end())
            {
                e[v].erase(a);
            }
            else
            {
                e[v].insert(*i);
            }

            e[u].erase(i);
        }
    }
    else
    {
        while (!e[v].empty())
        {
            set <pll> :: iterator i=e[v].begin();

            pll a=(*i);
            a.X=1-a.X;

            if (e[u].find(a)!=e[u].end())
            {
                e[u].erase(a);
            }
            else
            {
                e[u].insert(*i);
            }

            e[v].erase(i);
        }

        e[v].swap(e[u]);
    }
}

void fill_dp(ll f)
{
    for(ll i=0;i<floor_g[f].size();i++)
    {
        ll v=floor_g[f][i];

        for (ll j=0;j<h[v].size();j++)
        {
            e[v].insert(h[v][j]);
        }

        dp[v]=back_edge[v];

        for(ll j=0;j<child[v].size();j++)
        {
            dp[v]=min(dp[v] , dp[child[v][j]]);

            dsu(v , child[v][j]);
        }

        if (f==0 && (ll)(e[v].size())!=0)
        {
            cout<<"PNo";
            exit(0);
        }

        if (dp[v]>=f)
        {
            //cout<<":D "<<v<<" "<<dp[v]<<" "<<back_edge[v]<<" "<<e[v].size()<<" ";
            ll c=0;

            set <pll> :: iterator a=upper_bound(e[v].begin() , e[v].end() , mp((ll)0 , (ll)(-1)));
            set <pll> :: iterator b=upper_bound(e[v].begin() , e[v].end() , mp((ll)1 , (ll)(-1)));

            //cout<<a->X<<" "<<a->Y<<" :P "<<b->X<<" "<<b->Y<<endl;

            if (a!=e[v].end() && (a->X)==0)
            {
                c++;
            }

            if (b!=e[v].end() && (b->X)==1)
            {
                c++;
            }

            if (c==2)
            {
                cout<<"No";
                exit(0);
            }
        }
    }
}

void dfs(ll v , ll f)
{
    back_edge[v]=f;

    check[v]=true;

    if (f>=maxf)
    {
        maxf=f;
        floor_g[f].clear();
    }

    floor_g[f].pb(v);
    floor_v[v]=f;

    bool t=false;

    for(ll i=0;i<vertex[v].size();i++)
    {
        if (!check[vertex[v][i]])
        {
            par[vertex[v][i]]=v;

            dfs(vertex[v][i] , f+1);

            child[v].pb(vertex[v][i]);
        }
        else
        {
            if (!t && vertex[v][i]==par[v])
            {
                t=true;
                continue;
            }

            back_edge[v]=min(back_edge[v] , floor_v[vertex[v][i]]);
        }
    }
}

void ok(ll v)
{
    maxf=0;

    dfs(v , 0);

    for(ll i=maxf;i>=0;i--)
    {
        fill_dp(i);
    }
}

void update(ll v)
{
    if (head[head[v]]!=head[v])
    {
        update(head[v]);
    }

    head[v]=head[head[v]];
}

void pre_dsu(ll v , ll u)
{
    update(v);
    update(u);

    if (head[v]==head[u])
    {
        return;
    }

    if (len[head[v]]<len[head[u]])
    {
        head[head[v]]=head[u];
        len[head[u]]+=len[head[v]];
    }
    else
    {
        head[head[u]]=head[v];
        len[head[v]]+=len[head[u]];
    }
}

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);

    ll n,m,q;
    cin>>n>>m>>q;

    for(ll i=1;i<=n;i++)
    {
        head[i]=i;
        len[i]=1;
    }

    for(ll i=0;i<m;i++)
    {
        ll v,u;
        cin>>v>>u;

        vertex[v].pb(u);
        vertex[u].pb(v);

        pre_dsu(v , u);
    }

    for(ll i=1;i<=n;i++)
    {
        update(i);
    }

    for(ll i=0;i<q;i++)
    {
        ll v,u;
        cin>>v>>u;

        h[v].pb(mp(0 , i));
        h[u].pb(mp(1 , i));

        if (head[v]!=head[u])
        {
            cout<<"No";
            return 0;
        }
    }

    for(ll i=1;i<=n;i++)
    {
        if (!check[i])
        {
            ok(i);
        }
    }

    cout<<"Yes";
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pll pair <ll , ll>

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair

#define X first
#define Y second

#define LB(x) (x & (-x))
#define BIT(a,b) ((ll)(a&(1<<b))==0 ? false : true)

const ll MAXN=2e5+10;
const ll MAX_LOG=30;
const ll INF=1e12+10;

vector < pair <ll , pll> > h[MAXN];

vector <ll> vertex[MAXN];
vector <ll> floor_g[MAXN];
vector <ll> child[MAXN];

vector <ll> ver;

pll seg[MAXN];

ll par[MAXN][MAX_LOG];

ll state[MAXN][2];

ll dp[MAXN];
ll floor_v[MAXN];
ll back_edge[MAXN];
ll len[MAXN];
ll head[MAXN];

bool check[MAXN];

ll cnt=0,maxf=0;

bool is_par(ll v , ll u)
{
    if (seg[v].X<=seg[u].X && seg[v].Y>=seg[u].Y)
    {
        return true;
    }

    return false;
}

ll lca(ll v , ll u)
{
    if (is_par(v , u))
    {
        return v;
    }

    if (is_par(u , v))
    {
        return u;
    }

    for(ll i=MAX_LOG-1;i>=0;i--)
    {
        if (!is_par(par[v][i] , u))
        {
            v=par[v][i];
        }
    }

    return par[v][0];
}

void fill_dp(ll f)
{
    for(ll i=0;i<floor_g[f].size();i++)
    {
        ll v=floor_g[f][i];

        for (ll j=0;j<h[v].size();j++)
        {
            state[v][h[v][j].X]=min(state[v][h[v][j].X] , floor_v[lca(h[v][j].Y.X , h[v][j].Y.Y)]);
        }

        dp[v]=back_edge[v];

        for(ll j=0;j<child[v].size();j++)
        {
            dp[v]=min(dp[v] , dp[child[v][j]]);

            state[v][0]=min(state[v][0] , state[child[v][j]][0]);
            state[v][1]=min(state[v][1] , state[child[v][j]][1]);
        }

        //cout<<v<<" "<<dp[v]<<" "<<state[v][0]<<" "<<state[v][1]<<endl;

        if (dp[v]>=f)
        {
            if (state[v][0]<f && state[v][1]<f)
            {
                cout<<"No";
                exit(0);
            }
        }
    }
}

void dfs(ll v , ll f)
{
    seg[v].X=cnt++;

    back_edge[v]=f;

    check[v]=true;

    ver.pb(v);

    if (f>maxf)
    {
        maxf=f;
        floor_g[f].clear();
    }

    floor_g[f].pb(v);
    floor_v[v]=f;

    bool t=false;

    for(ll i=0;i<vertex[v].size();i++)
    {
        if (!check[vertex[v][i]])
        {
            par[vertex[v][i]][0]=v;

            dfs(vertex[v][i] , f+1);

            child[v].pb(vertex[v][i]);
        }
        else
        {
            if (!t && vertex[v][i]==par[v][0])
            {
                t=true;
                continue;
            }

            back_edge[v]=min(back_edge[v] , floor_v[vertex[v][i]]);
        }
    }

    seg[v].Y=cnt++;
}

void ok(ll v)
{
    maxf=-1;
    cnt=0;

    ver.clear();

    dfs(v , 0);

    par[v][0]=v;

    for(ll i=1;i<MAX_LOG;i++)
    {
        for(ll j=0;j<ver.size();j++)
        {
            par[ver[j]][i]=par[par[ver[j]][i-1]][i-1];
        }
    }

    for(ll i=maxf;i>=0;i--)
    {
        fill_dp(i);
    }
}

void update(ll v)
{
    if (head[head[v]]!=head[v])
    {
        update(head[v]);
    }

    head[v]=head[head[v]];
}

void dsu(ll v , ll u)
{
    if (head[v]==head[u])
    {
        return;
    }

    if (len[head[v]]<len[head[u]])
    {
        head[head[v]]=head[u];
        len[head[u]]+=len[head[v]];
    }
    else
    {
        head[head[u]]=head[v];
        len[head[v]]+=len[head[u]];
    }
}

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);

    ll n,m,q;
    cin>>n>>m>>q;

    for(ll i=1;i<=n;i++)
    {
        head[i]=i;
        len[i]=1;
    }

    for(ll i=0;i<m;i++)
    {
        ll v,u;
        cin>>v>>u;

        vertex[v].pb(u);
        vertex[u].pb(v);

        dsu(v , u);
    }

    for(ll i=1;i<=n;i++)
    {
        update(i);
    }

    for(ll i=0;i<q;i++)
    {
        ll v,u;
        cin>>v>>u;

        h[v].pb(mp(0 , mp(v , u)));
        h[u].pb(mp(1 , mp(v , u)));

        if (head[v]!=head[u])
        {
            cout<<"No";
            return 0;
        }
    }

    for(ll i=0;i<MAXN;i++)
    {
        state[i][0]=INF;
        state[i][1]=INF;
    }

    for(ll i=1;i<=n;i++)
    {
        if (!check[i])
        {
            ok(i);
        }
    }

    cout<<"Yes";
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pll pair <ll , ll>

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair

#define X first
#define Y second

#define LB(x) (x & (-x))
#define BIT(a,b) ((ll)(a&(1<<b))==0 ? false : true)

const ll MAXN=2e5+10;
const ll MAX_LOG=30;
const ll INF=1e12+10;

vector < pair <ll , pll> > h[MAXN];

vector <ll> vertex[MAXN];
vector <ll> floor_g[MAXN];
vector <ll> child[MAXN];

vector <ll> ver;

pll seg[MAXN];

ll par[MAXN][MAX_LOG];

ll state[MAXN][2];

ll dp[MAXN];
ll floor_v[MAXN];
ll back_edge[MAXN];

bool check[MAXN];

ll cnt=0,maxf=0;

bool is_par(ll v , ll u)
{
    if (seg[v].X<=seg[u].X && seg[v].Y>=seg[u].Y)
    {
        return true;
    }

    return false;
}

ll lca(ll v , ll u)
{
    if (is_par(v , u))
    {
        return v;
    }

    if (is_par(u , v))
    {
        return u;
    }

    for(ll i=MAX_LOG-1;i>=0;i--)
    {
        if (!is_par(par[v][i] , u))
        {
            v=par[v][i];
        }
    }

    return par[v][0];
}

void fill_dp(ll f)
{
    for(ll i=0;i<floor_g[f].size();i++)
    {
        ll v=floor_g[f][i];

        for (ll j=0;j<h[v].size();j++)
        {
            state[v][h[v][j].X]=min(state[v][h[v][j].X] , floor_v[lca(h[v][j].Y.X , h[v][j].Y.Y)]);
        }

        dp[v]=back_edge[v];

        for(ll j=0;j<child[v].size();j++)
        {
            dp[v]=min(dp[v] , dp[child[v][j]]);

            state[v][0]=min(state[v][0] , state[child[v][j]][0]);
            state[v][1]=min(state[v][1] , state[child[v][j]][1]);
        }

        //<<v<<" "<<dp[v]<<" "<<state[v][0]<<" "<<state[v][1]<<endl;

        if (dp[v]>=f)
        {
            if (state[v][0]<f && state[v][1]<f)
            {
                cout<<"No";
                exit(0);
            }
        }
    }
}

void dfs(ll v , ll f)
{
    seg[v].X=cnt++;

    back_edge[v]=f;

    check[v]=true;

    ver.pb(v);

    if (f>maxf)
    {
        maxf=f;
        floor_g[f].clear();
    }

    floor_g[f].pb(v);
    floor_v[v]=f;

    bool t=false;

    for(ll i=0;i<vertex[v].size();i++)
    {
        if (!check[vertex[v][i]])
        {
            par[vertex[v][i]][0]=v;

            dfs(vertex[v][i] , f+1);

            child[v].pb(vertex[v][i]);
        }
        else
        {
            if (!t && vertex[v][i]==par[v][0])
            {
                t=true;
                continue;
            }

            back_edge[v]=min(back_edge[v] , floor_v[vertex[v][i]]);
        }
    }

    seg[v].Y=cnt++;
}

void ok(ll v)
{
    maxf=-1;
    cnt=0;

    ver.clear();

    dfs(v , 0);

    par[v][0]=v;

    for(ll i=1;i<MAX_LOG;i++)
    {
        for(ll j=0;j<ver.size();j++)
        {
            par[ver[j]][i]=par[par[ver[j]][i-1]][i-1];
        }
    }

    for(ll i=maxf;i>=0;i--)
    {
        fill_dp(i);
    }
}

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);

    ll n,m,q;
    cin>>n>>m>>q;

    for(ll i=0;i<m;i++)
    {
        ll v,u;
        cin>>v>>u;

        vertex[v].pb(u);
        vertex[u].pb(v);
    }

    for(ll i=0;i<q;i++)
    {
        ll v,u;
        cin>>v>>u;

        h[v].pb(mp(0 , mp(v , u)));
        h[u].pb(mp(1 , mp(v , u)));
    }

    for(ll i=0;i<MAXN;i++)
    {
        state[i][0]=INF;
        state[i][1]=INF;
    }

    for(ll i=1;i<=n;i++)
    {
        if (!check[i])
        {
            ok(i);
        }
    }

    cout<<"Yes";
}