#include<bits/stdc++.h>
using namespace std;
#define NMAX 200100
int num[NMAX];
int low[NMAX];
int par[NMAX][20];
int up[NMAX];
int down[NMAX];
int lv[NMAX];
int root[NMAX];
int findd(int x)
{
    //printf("find %d\n",x);
    if(root[x]==-1) return x;
    return root[x]=findd(root[x]);
}
void unionn(int x,int y)
{
    if(findd(x)==findd(y)) return ;
    root[findd(y)]=findd(x);
}
vector<int> a[200100];
vector<int> e;
int cnt=0;
void dfs(int x,int last)
{
    num[x]=low[x]=++cnt;
    //printf("%d %d %d %d\n",x,last,num[x],low[x]);
    for(int i=0;i<a[x].size();i++)
    {
        int y=e[a[x][i]]-x;
        if(y==last){last=0; continue;}
        if(!num[y])
        {
            dfs(y,x);
            low[x]=min(low[x],low[y]);
        }
        else
        {
            low[x]=min(low[x],num[y]);
        }
        if(low[y]<=num[x])
        unionn(x,y);
        else
        {
            par[findd(y)][0]=x;
        }
    }
}
bool cmp(int x,int y)
{
    return num[x]<num[y];
}
void init(int x)
{
    for(int j=1;j<=18;j++) par[x][j]=par[par[x][j-1]][j-1];
}
int goup(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(down[x])
    {
        printf("No"); exit(0);
    }
    if(up[x])
    return goup(up[x],z);
    else return up[x]=goup(par[x][0],z);
}
int godown(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(up[x])
    {
        printf("No"); exit(0);
    }
    if(down[x])
    return godown(down[x],z);
    else return down[x]=godown(par[x][0],z);
}
int lca(int x,int y)
{
    int i;
    if(lv[x]<lv[y]) swap(x,y);
    for(i=18;i>=0;i--)
    {
        if(lv[par[x][i]]>=lv[y]) x=par[x][i];
    }
     //  printf("find lca %d %d %d %d\n",x,y,lv[x],lv[y]);
    for(i=18;i>=0;i--)
    {
        if(par[x][i]!=par[y][i]) {x=par[x][i]; y=par[y][i];}
    }
    while(x!=y) {x=par[x][0]; y=par[y][0];} return x;
}
vector<int> nen;
int main()
{
    int n,m,q,i,j,x,y;
    //freopen("test.inp","r",stdin);
    //freopen("test.out","w",stdout);
    memset(root,-1,sizeof root);
    scanf("%d %d %d",&n,&m,&q);
    for(i=0;i<m;i++)
    {
        scanf("%d %d",&x,&y);
        //printf("%d %d\n",x,y);
        e.push_back(x+y);
        a[x].push_back(i);
        a[y].push_back(i);
    }
    for(i=1;i<=n;i++) if(!num[i]) dfs(i,i);
    for(i=1;i<=n;i++) nen.push_back(i);
    sort(nen.begin(),nen.end(),cmp);
    for(i=0;i<n;i++)
    {
        int j=i; i=nen[i];
        //printf("start find %d\n",i);
        //printf("%d %d\n",i,findd(i));
        if(lv[findd(i)]) {i=j;continue;}
        if(!par[findd(i)][0])  par[findd(i)][0]=n+1;
        par[findd(i)][0]=findd(par[findd(i)][0]); lv[findd(i)]=lv[par[findd(i)][0]]+1; init(i); i=j;
    }
    while(q--)
    {
        scanf("%d %d",&x,&y);
        x=findd(x); y=findd(y); if(x==y) continue;
        int z=lca(x,y);
        //printf("%d %d %d\n",x,y,z);
        if(z==n+1)
        {
            printf("No"); return 0;
        }
        goup(x,z);
        godown(y,z);
    }
    printf("Yes");
}


#include<bits/stdc++.h>
using namespace std;
#define NMAX 200100
int num[NMAX];
int low[NMAX];
int par[NMAX][20];
int up[NMAX];
int down[NMAX];
int lv[NMAX];
int root[NMAX];
int findd(int x)
{
    //printf("find %d\n",x);
    if(root[x]==-1) return x;
    return root[x]=findd(root[x]);
}
void unionn(int x,int y)
{
    if(findd(x)==findd(y)) return ;
    root[findd(y)]=findd(x);
}
vector<int> a[200100];
vector<int> e;
int cnt=0;
void dfs(int x,int last)
{
    num[x]=low[x]=++cnt;
    //printf("%d %d %d %d\n",x,last,num[x],low[x]);
    for(int i=0;i<a[x].size();i++)
    {
        int y=e[a[x][i]]-x;
        if(y==last){last=0; continue;}
        if(!num[y])
        {
            dfs(y,x);
            low[x]=min(low[x],low[y]);
        }
        else
        {
            low[x]=min(low[x],num[y]);
        }
        if(low[y]<=num[x])
        unionn(x,y);
        else
        {
            par[findd(y)][0]=x;
        }
    }
}
bool cmp(int x,int y)
{
    return num[x]<num[y];
}
void init(int x)
{
    for(int j=1;j<=18;j++) par[x][j]=par[par[x][j-1]][j-1];
}
int goup(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(down[x])
    {
        printf("NO"); exit(0);
    }
    if(up[x])
    return goup(up[x],z);
    else return up[x]=goup(par[x][0],z);
}
int godown(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(up[x])
    {
        printf("NO"); exit(0);
    }
    if(down[x])
    return godown(down[x],z);
    else return down[x]=godown(par[x][0],z);
}
int lca(int x,int y)
{
    int i;
    if(lv[x]<lv[y]) swap(x,y);
    for(i=18;i>=0;i--)
    {
        if(lv[par[x][i]]>=lv[y]) x=par[x][i];
    }
    for(i=18;i>=0;i--)
    {
        if(x!=y) {x=par[x][i]; y=par[y][i];}
    }
    while(x!=y) {x=par[x][0]; y=par[y][0];} return x;
}
vector<int> nen;
int main()
{
    int n,m,q,i,j,x,y;
    //freopen("test.inp","r",stdin);
    memset(root,-1,sizeof root);
    scanf("%d %d %d",&n,&m,&q);
    for(i=0;i<m;i++)
    {
        scanf("%d %d",&x,&y);
        //printf("%d %d\n",x,y);
        e.push_back(x+y);
        a[x].push_back(i);
        a[y].push_back(i);
    }
    dfs(1,1);
    for(i=1;i<=n;i++) nen.push_back(i);
    sort(nen.begin(),nen.end(),cmp);
    for(i=0;i<n;i++)
    {
        int j=i; i=nen[i];
        //printf("start find %d\n",i);
        ////printf("%d %d\n",i,findd(i));
        if(lv[findd(i)]) {i=j;continue;}
        par[findd(i)][0]=findd(par[findd(i)][0]); lv[findd(i)]=lv[par[findd(i)][0]]+1; init(i); i=j;
    }
    while(q--)
    {
        scanf("%d %d",&x,&y);
        x=findd(x); y=findd(y); if(x==y) continue;
        int z=lca(x,y);
        goup(x,z);
        godown(y,z);
    }
    printf("YES");
}


#include<bits/stdc++.h>
using namespace std;
#define NMAX 200100
int num[NMAX];
int low[NMAX];
int par[NMAX][20];
int up[NMAX];
int down[NMAX];
int lv[NMAX];
int root[NMAX];
int findd(int x)
{
    //printf("find %d\n",x);
    if(root[x]==-1) return x;
    return root[x]=findd(root[x]);
}
void unionn(int x,int y)
{
    if(findd(x)==findd(y)) return ;
    root[findd(y)]=findd(x);
}
vector<int> a[200100];
vector<int> e;
int cnt=0;
void dfs(int x,int last)
{
    num[x]=low[x]=++cnt;
    //printf("%d %d %d %d\n",x,last,num[x],low[x]);
    for(int i=0;i<a[x].size();i++)
    {
        int y=e[a[x][i]]-x;
        if(y==last){last=0; continue;}
        if(!num[y])
        {
            dfs(y,x);
            low[x]=min(low[x],low[y]);
        }
        else
        {
            low[x]=min(low[x],num[y]);
        }
        if(low[y]<=num[x])
        unionn(x,y);
        else
        {
            par[findd(y)][0]=x;
        }
    }
}
bool cmp(int x,int y)
{
    return num[x]<num[y];
}
void init(int x)
{
    for(int j=1;j<=18;j++) par[x][j]=par[par[x][j-1]][j-1];
}
int goup(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(down[x])
    {
        printf("NO"); exit(0);
    }
    if(up[x])
    return goup(up[x],z);
    else return up[x]=goup(par[x][0],z);
}
int godown(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(up[x])
    {
        printf("NO"); exit(0);
    }
    if(down[x])
    return godown(down[x],z);
    else return down[x]=godown(par[x][0],z);
}
int lca(int x,int y)
{
    int i;
    if(lv[x]<lv[y]) swap(x,y);
    for(i=18;i>=0;i--)
    {
        if(lv[par[x][i]]>=lv[y]) x=par[x][i];
    }
     //  printf("find lca %d %d %d %d\n",x,y,lv[x],lv[y]);
    for(i=18;i>=0;i--)
    {
        if(par[x][i]!=par[y][i]) {x=par[x][i]; y=par[y][i];}
    }
    while(x!=y) {x=par[x][0]; y=par[y][0];} return x;
}
vector<int> nen;
int main()
{
    int n,m,q,i,j,x,y;
    //freopen("test.inp","r",stdin);
    memset(root,-1,sizeof root);
    scanf("%d %d %d",&n,&m,&q);
    for(i=0;i<m;i++)
    {
        scanf("%d %d",&x,&y);
        //printf("%d %d\n",x,y);
        e.push_back(x+y);
        a[x].push_back(i);
        a[y].push_back(i);
    }
    for(i=1;i<=n;i++) if(!num[i]) dfs(i,i);
    for(i=1;i<=n;i++) nen.push_back(i);
    sort(nen.begin(),nen.end(),cmp);
    for(i=0;i<n;i++)
    {
        int j=i; i=nen[i];
        //printf("start find %d\n",i);
        ////printf("%d %d\n",i,findd(i));
        if(lv[findd(i)]) {i=j;continue;}
        if(!par[findd(i)][0])  par[findd(i)][0]=n+1;
        par[findd(i)][0]=findd(par[findd(i)][0]); lv[findd(i)]=lv[par[findd(i)][0]]+1; init(i); i=j;
    }
    while(q--)
    {
        scanf("%d %d",&x,&y);
        x=findd(x); y=findd(y); if(x==y) continue;
        int z=lca(x,y);
       // printf("%d %d %d\n",x,y,z);
        if(z==0)
        {
            printf("NO"); return 0;
        }
        goup(x,z);
        godown(y,z);
    }
    printf("YES");
}


#include<bits/stdc++.h>
using namespace std;
#define NMAX 200100
int num[NMAX];
int low[NMAX];
int par[NMAX][20];
int up[NMAX];
int down[NMAX];
int lv[NMAX];
int root[NMAX];
int findd(int x)
{
    //printf("find %d\n",x);
    if(root[x]==-1) return x;
    return root[x]=findd(root[x]);
}
void unionn(int x,int y)
{
    if(findd(x)==findd(y)) return ;
    root[findd(y)]=findd(x);
}
vector<int> a[200100];
vector<int> e;
int cnt=0;
void dfs(int x,int last)
{
    num[x]=low[x]=++cnt;
    //printf("%d %d %d %d\n",x,last,num[x],low[x]);
    for(int i=0;i<a[x].size();i++)
    {
        int y=e[a[x][i]]-x;
        if(y==last){last=0; continue;}
        if(!num[y])
        {
            dfs(y,x);
            low[x]=min(low[x],low[y]);
        }
        else
        {
            low[x]=min(low[x],num[y]);
        }
        if(low[y]<=num[x])
        unionn(x,y);
        else
        {
            par[findd(y)][0]=x;
        }
    }
}
bool cmp(int x,int y)
{
    return num[x]<num[y];
}
void init(int x)
{
    for(int j=1;j<=18;j++) par[x][j]=par[par[x][j-1]][j-1];
}
int goup(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(down[x])
    {
        printf("NO"); exit(0);
    }
    if(up[x])
    return goup(up[x],z);
    else return up[x]=goup(par[x][0],z);
}
int godown(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(up[x])
    {
        printf("NO"); exit(0);
    }
    if(down[x])
    return godown(down[x],z);
    else return down[x]=godown(par[x][0],z);
}
int lca(int x,int y)
{
    int i;
    if(lv[x]<lv[y]) swap(x,y);
    for(i=18;i>=0;i--)
    {
        if(lv[par[x][i]]>=lv[y]) x=par[x][i];
    }
    for(i=18;i>=0;i--)
    {
        if(x!=y) {x=par[x][i]; y=par[y][i];}
    }
    while(x!=y) {x=par[x][0]; y=par[y][0];} return x;
}
vector<int> nen;
int main()
{
    int n,m,q,i,j,x,y;
    //freopen("test.inp","r",stdin);
    memset(root,-1,sizeof root);
    scanf("%d %d %d",&n,&m,&q);
    for(i=0;i<m;i++)
    {
        scanf("%d %d",&x,&y);
        //printf("%d %d\n",x,y);
        e.push_back(x+y);
        a[x].push_back(i);
        a[y].push_back(i);
    }
    dfs(1,1);
    for(i=1;i<=n;i++) nen.push_back(i);
    sort(nen.begin(),nen.end(),cmp);
    for(i=0;i<n;i++)
    {
        int j=i; i=nen[i];
        //printf("start find %d\n",i);
        ////printf("%d %d\n",i,findd(i));
        if(lv[findd(i)]) {i=j;continue;}
        par[findd(i)][0]=findd(par[findd(i)][0]); lv[findd(i)]=lv[par[findd(i)][0]]+1; init(i); i=j;
    }
    while(q--)
    {
        scanf("%d %d",&x,&y);
        x=findd(x); y=findd(y); if(x==y) continue;
        int z=lca(x,y);
        if(z==0)
        {
            printf("NO"); return 0;
        }
        goup(x,z);
        godown(y,z);
    }
    printf("YES");
}


#include<bits/stdc++.h>
using namespace std;
#define NMAX 200100
int num[NMAX];
int low[NMAX];
int par[NMAX][20];
int up[NMAX];
int down[NMAX];
int lv[NMAX];
int root[NMAX];
int findd(int x)
{
    //printf("find %d\n",x);
    if(root[x]==-1) return x;
    return root[x]=findd(root[x]);
}
void unionn(int x,int y)
{
    if(findd(x)==findd(y)) return ;
    root[findd(y)]=findd(x);
}
vector<int> a[200100];
vector<int> e;
int cnt=0;
void dfs(int x,int last)
{
    num[x]=low[x]=++cnt;
    //printf("%d %d %d %d\n",x,last,num[x],low[x]);
    for(int i=0;i<a[x].size();i++)
    {
        int y=e[a[x][i]]-x;
        if(y==last){last=0; continue;}
        if(!num[y])
        {
            dfs(y,x);
            low[x]=min(low[x],low[y]);
        }
        else
        {
            low[x]=min(low[x],num[y]);
        }
        if(low[y]<=num[x])
        unionn(x,y);
        else
        {
            par[findd(y)][0]=x;
        }
    }
}
bool cmp(int x,int y)
{
    return num[x]<num[y];
}
void init(int x)
{
    for(int j=1;j<=18;j++) par[x][j]=par[par[x][j-1]][j-1];
}
int goup(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(down[x])
    {
        printf("No"); exit(0);
    }
    if(up[x])
    return goup(up[x],z);
    else return up[x]=goup(par[x][0],z);
}
int godown(int x,int z)
{
    if(lv[x]<=lv[z]) return x;
    if(up[x])
    {
        printf("No"); exit(0);
    }
    if(down[x])
    return godown(down[x],z);
    else return down[x]=godown(par[x][0],z);
}
int lca(int x,int y)
{
    int i;
    if(lv[x]<lv[y]) swap(x,y);
    for(i=18;i>=0;i--)
    {
        if(lv[par[x][i]]>=lv[y]) x=par[x][i];
    }
     //  printf("find lca %d %d %d %d\n",x,y,lv[x],lv[y]);
    for(i=18;i>=0;i--)
    {
        if(par[x][i]!=par[y][i]) {x=par[x][i]; y=par[y][i];}
    }
    while(x!=y) {x=par[x][0]; y=par[y][0];} return x;
}
vector<int> nen;
int main()
{
    int n,m,q,i,j,x,y;
    //freopen("test.inp","r",stdin);
    //freopen("test.out","w",stdout);
    memset(root,-1,sizeof root);
    scanf("%d %d %d",&n,&m,&q);
    for(i=0;i<m;i++)
    {
        scanf("%d %d",&x,&y);
        //printf("%d %d\n",x,y);
        e.push_back(x+y);
        a[x].push_back(i);
        a[y].push_back(i);
    }
    for(i=1;i<=n;i++) if(!num[i]) dfs(i,i);
    for(i=1;i<=n;i++) nen.push_back(i);
    sort(nen.begin(),nen.end(),cmp);
    for(i=0;i<n;i++)
    {
        int j=i; i=nen[i];
        //printf("start find %d\n",i);
        printf("%d %d\n",i,findd(i));
        if(lv[findd(i)]) {i=j;continue;}
        if(!par[findd(i)][0])  par[findd(i)][0]=n+1;
        par[findd(i)][0]=findd(par[findd(i)][0]); lv[findd(i)]=lv[par[findd(i)][0]]+1; init(i); i=j;
    }
    while(q--)
    {
        scanf("%d %d",&x,&y);
        x=findd(x); y=findd(y); if(x==y) continue;
        int z=lca(x,y);
        //printf("%d %d %d\n",x,y,z);
        if(z==n+1)
        {
            printf("No"); return 0;
        }
        goup(x,z);
        godown(y,z);
    }
    printf("Yes");
}


//Pranet Verma
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
vector<int> g[200001],G[200001];
bool vis[200001];
int reach[200001],dep[200001];
vector<pii> bridges;
int PA[200001],pa[20][200001];
int fs(int u)
{
    return PA[u]=(PA[u]==u?u:fs(PA[u]));
}
int component[200001];
#define count sdagsfdggfd
map<pair<int,int>,int > count;
void bridge_dfs(int u,int p,int comp)
{
    assert(!vis[u]);
    vis[u]=1;
    dep[u]=dep[p]+1;
    PA[u]=p;
    reach[u]=dep[u];
    if(p==0)
        PA[u]=u;
    component[u]=comp;
    for(int i=0;i<(int)g[u].size();++i)
    {
        int v=g[u][i];
        if(v==p)
            continue;
        if(!vis[v])
        {
            bridge_dfs(v,u,comp);
            if(reach[v]>dep[u])
            {

                    pii key;
                    key.first=min(u,v);
                    key.second=max(u,v);
                    if(count[key]==0)
                        assert(0);
                    if(count[key]==1)
                    {
                        PA[v]=v;
                        bridges.push_back(make_pair(u,v));
                    }
            }
            reach[u]=min(reach[u],reach[v]);
        }
        else
            reach[u]=min(reach[u],dep[v]);
    }
}
void dfs(int u,int p)
{
    assert(!vis[u]);
    vis[u]=1;
    dep[u]=dep[p]+1;
    pa[0][u]=p;
    for(int i=0;i<(int)G[u].size();++i)
    {
        int v=G[u][i];
        if(v==p)
            continue;
        dfs(v,u);
    }
}
int lca(int u,int v)
{
    if(dep[u]<dep[v])
        swap(u,v);
    int d=dep[u]-dep[v];
    for(int i=19;i>=0;--i)
        if(d&(1<<i))
            u=pa[i][u];
    if(u==v)
        return u;
    for(int i=19;i>=0;--i)
        if(pa[i][u]!=pa[i][v])
            u=pa[i][u],
            v=pa[i][v];
    return pa[0][u];
}
int kthAncestor(int u,int k)
{
    for(int i=17;i>=0;--i)
        if(k&(1<<i))
            u=pa[i][u];
    return u;
}
int awayFrom[200001];
int towards[200001];

int totalAway=0;
int totalTowards=0;
void dfs2(int u,int p)
{
    assert(!vis[u]);
    vis[u]=1;
    for(int i=0;i<(int)G[u].size();++i)
    {
        int v=G[u][i];
        if(v==p)
            continue;
        dfs2(v,u);
        awayFrom[u]+=awayFrom[v];
        towards[u]+=towards[v];
    }
}
int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m,q;
    cin>>n>>m>>q;
    for(int i=0;i<m;++i)
    {
        int u,v;
        cin>>u>>v;
        g[u].push_back(v);
        g[v].push_back(u);

        if(u>v)
            swap(u,v);
        pii key=make_pair(u,v);
        count[key]+=1;
    }
    for(int i=1;i<=n;++i)
        if(!vis[i])
            bridge_dfs(i,0,i);
    for(int i=0;i<(int)bridges.size();++i)
    {
        int u=bridges[i].first;
        int v=bridges[i].second;
        G[fs(u)].push_back(fs(v));
        G[fs(v)].push_back(fs(u));
    }
    memset(vis,0,sizeof vis);
    for(int i=1;i<=n;++i)
        if(!vis[fs(i)])
            dfs(fs(i),0);
    for(int j=1;j<18;++j)
        for(int i=1;i<=n;++i)
            pa[j][fs(i)]=pa[j-1][pa[j-1][fs(i)]];
    while(q--)
    {
        int u,v;
        cin>>u>>v;
        if(component[u]!=component[v])
        {
            cout<<"No\n";
            return 0;
        }
        u=fs(u);
        v=fs(v);
        int l=lca(u,v);
        awayFrom[u]+=1;
        awayFrom[l]-=1;
        towards[v]+=1;
        towards[l]-=1;
    }
    memset(vis,0,sizeof vis);
    for(int i=1;i<=n;++i)
        if(!vis[fs(i)])
            dfs2(fs(i),0);

    for(int i=1;i<=n;++i)
    {
        if(awayFrom[i] && towards[i])
        {
            cout<<"No\n";
            return 0;
        }
    }
    cout<<"Yes\n";
}


//Pranet Verma
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
vector<int> g[100001],G[100001];
bool vis[100001];
int reach[100001],dep[100001];
vector<pii> bridges;
int PA[100001],pa[18][100001];
int fs(int u)
{
    return PA[u]=(PA[u]==u?u:fs(PA[u]));
}
int component[100001];
#define count sdagsfdggfd
map<pair<int,int>,int > count;
void bridge_dfs(int u,int p,int comp)
{
    assert(!vis[u]);
    vis[u]=1;
    dep[u]=dep[p]+1;
    PA[u]=p;
    reach[u]=dep[u];
    if(p==0)
        PA[u]=u;
    component[u]=comp;
    for(int i=0;i<(int)g[u].size();++i)
    {
        int v=g[u][i];
        if(v==p)
            continue;
        if(!vis[v])
        {
            bridge_dfs(v,u,comp);
            if(reach[v]>dep[u])
            {

                    pii key;
                    key.first=min(u,v);
                    key.second=max(u,v);
                    if(count[key]==0)
                        assert(0);
                    if(count[key]==1)
                    {
                        PA[v]=v;
                        bridges.push_back(make_pair(u,v));
                    }
            }
            reach[u]=min(reach[u],reach[v]);
        }
        else
            reach[u]=min(reach[u],dep[v]);
    }
}
void dfs(int u,int p)
{
    assert(!vis[u]);
    vis[u]=1;
    dep[u]=dep[p]+1;
    pa[0][u]=p;
    for(int i=0;i<(int)G[u].size();++i)
    {
        int v=G[u][i];
        if(v==p)
            continue;
        dfs(v,u);
    }
}
int lca(int u,int v)
{
    if(dep[u]<dep[v])
        swap(u,v);
    int d=dep[u]-dep[v];
    for(int i=17;i>=0;--i)
        if(d&(1<<i))
            u=pa[i][u];
    if(u==v)
        return u;
    for(int i=17;i>=0;--i)
        if(pa[i][u]!=pa[i][v])
            u=pa[i][u],
            v=pa[i][v];
    return pa[0][u];
}
int kthAncestor(int u,int k)
{
    for(int i=17;i>=0;--i)
        if(k&(1<<i))
            u=pa[i][u];
    return u;
}
int awayFrom[100001];
int towards[100001];

int totalAway=0;
int totalTowards=0;
void dfs2(int u,int p)
{
    assert(!vis[u]);
    vis[u]=1;
    for(int i=0;i<(int)G[u].size();++i)
    {
        int v=G[u][i];
        if(v==p)
            continue;
        dfs2(v,u);
        awayFrom[u]+=awayFrom[v];
        towards[u]+=towards[v];
    }
}
int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m,q;
    cin>>n>>m>>q;
    for(int i=0;i<m;++i)
    {
        int u,v;
        cin>>u>>v;
        g[u].push_back(v);
        g[v].push_back(u);

        if(u>v)
            swap(u,v);
        pii key=make_pair(u,v);
        count[key]+=1;
    }
    for(int i=1;i<=n;++i)
        if(!vis[i])
            bridge_dfs(i,0,i);
    for(int i=0;i<(int)bridges.size();++i)
    {
        int u=bridges[i].first;
        int v=bridges[i].second;
        G[fs(u)].push_back(fs(v));
        G[fs(v)].push_back(fs(u));
    }
    memset(vis,0,sizeof vis);
    for(int i=1;i<=n;++i)
        if(!vis[fs(i)])
            dfs(fs(i),0);
    for(int j=1;j<18;++j)
        for(int i=1;i<=n;++i)
            pa[j][fs(i)]=pa[j-1][pa[j-1][fs(i)]];
    while(q--)
    {
        int u,v;
        cin>>u>>v;

        if(component[u]!=component[v])
        {
            cout<<"No\n";
            return 0;
        }
        u=fs(u);
        v=fs(v);
        int l=lca(u,v);
        awayFrom[u]+=1;
        awayFrom[l]-=1;
        towards[v]+=1;
        towards[l]-=1;
    }
    // for(int i=1;i<=n;++i)
    //     cout<<i<<" "<<awayFrom[i]<<" "<<towards[i]<<endl;
    memset(vis,0,sizeof vis);
    for(int i=1;i<=n;++i)
        if(!vis[fs(i)])
            dfs2(fs(i),0);
    // for(int i=1;i<=n;++i)
    //     cout<<i<<" "<<awayFrom[i]<<" "<<towards[i]<<endl;

    for(int i=1;i<=n;++i)
    {

        if(awayFrom[i] && towards[i])
        {
            cout<<"No\n";
            return 0;
        }
    }
    cout<<"Yes\n";
}


//Pranet Verma
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
vector<int> g[100001],G[100001];
bool vis[100001];
int reach[100001],dep[100001];
vector<pii> bridges;
int PA[100001],pa[18][100001];
int fs(int u)
{
    return PA[u]=(PA[u]==u?u:fs(PA[u]));
}
int component[100001];
#define count sdagsfdggfd
map<pair<int,int>,int > count;
void bridge_dfs(int u,int p,int comp)
{
    assert(!vis[u]);
    vis[u]=1;
    dep[u]=dep[p]+1;
    PA[u]=p;
    reach[u]=dep[u];
    if(p==0)
        PA[u]=u;
    component[u]=comp;
    for(int i=0;i<(int)g[u].size();++i)
    {
        int v=g[u][i];
        if(v==p)
            continue;
        if(!vis[v])
        {
            bridge_dfs(v,u,comp);
            if(reach[v]>dep[u])
            {

                    pii key;
                    key.first=min(u,v);
                    key.second=max(u,v);
                    if(count[key]==0)
                        assert(0);
                    if(count[key]==1)
                    {
                        PA[v]=v;
                        bridges.push_back(make_pair(u,v));
                    }
            }
            reach[u]=min(reach[u],reach[v]);
        }
        else
            reach[u]=min(reach[u],dep[v]);
    }
}
void dfs(int u,int p)
{
    assert(!vis[u]);
    vis[u]=1;
    dep[u]=dep[p]+1;
    pa[0][u]=p;
    for(int i=0;i<(int)G[u].size();++i)
    {
        int v=G[u][i];
        if(v==p)
            continue;
        dfs(v,u);
    }
}
int lca(int u,int v)
{
    if(dep[u]<dep[v])
        swap(u,v);
    int d=dep[u]-dep[v];
    for(int i=17;i>=0;--i)
        if(d&(1<<i))
            u=pa[i][u];
    if(u==v)
        return u;
    for(int i=17;i>=0;--i)
        if(pa[i][u]!=pa[i][v])
            u=pa[i][u],
            v=pa[i][v];
    return pa[0][u];
}
int kthAncestor(int u,int k)
{
    for(int i=17;i>=0;--i)
        if(k&(1<<i))
            u=pa[i][u];
    return u;
}
int awayFrom[100001];
int towards[100001];

int e1[100001];
int e2[100001];
void dfs2(int u,int p,int sumTowards,int sumAway)
{
    e1[u]=sumTowards;
    e2[u]=sumAway;
    vis[u]=1;
    for(int i=0;i<(int)G[u].size();++i)
    {
        int v=G[u][i];
        if(v==p)
            continue;
        dfs2(v,u,sumTowards+towards[u],sumAway+awayFrom[u]);
    }
}
int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m,q;
    cin>>n>>m>>q;
    for(int i=0;i<m;++i)
    {
        int u,v;
        cin>>u>>v;
        g[u].push_back(v);
        g[v].push_back(u);

        if(u>v)
            swap(u,v);
        pii key=make_pair(u,v);
        count[key]+=1;
    }
    for(int i=1;i<=n;++i)
        if(!vis[i])
            bridge_dfs(i,0,i);
    for(int i=0;i<(int)bridges.size();++i)
    {
        int u=bridges[i].first;
        int v=bridges[i].second;
        G[fs(u)].push_back(fs(v));
        G[fs(v)].push_back(fs(u));
    }
    memset(vis,0,sizeof vis);
    for(int i=1;i<=n;++i)
        if(!vis[fs(i)])
            dfs(fs(i),0);
    for(int j=1;j<18;++j)
        for(int i=1;i<=n;++i)
            pa[j][fs(i)]=pa[j-1][pa[j-1][fs(i)]];
    while(q--)
    {
        int u,v;
        cin>>u>>v;

        if(component[u]!=component[v])
        {
            cout<<"No\n";
            return 0;
        }
        u=fs(u);
        v=fs(v);

        int l=lca(u,v);
        awayFrom[u]-=1;
        awayFrom[kthAncestor(u,dep[u]-dep[l])]+=1;

        towards[v]-=1;
        towards[kthAncestor(v,dep[v]-dep[l])]+=1;
    }
    memset(vis,0,sizeof vis);
    for(int i=1;i<=n;++i)
        if(!vis[fs(i)])
            dfs2(fs(i),0,0,0);
    for(int i=1;i<=n;++i)
    {
        if(e1[i] && e2[i])
        {
            cout<<"No\n";
            return 0;
        }
    }
    cout<<"Yes\n";
}


//In the name of God
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5 + 9;
const int lg = 21;
int cnt,cmp[Maxn],cut[Maxn];
int h[Maxn],s[Maxn],t[Maxn];
vector<pair<int,int> > al[Maxn];
vector<int> vt[Maxn],qt[Maxn];
vector<int> adj[Maxn];
int pl[Maxn];
int par[Maxn][lg];
vector<int> eli[Maxn];
vector<int> ver,query;
pair<int,int> edge[Maxn];
int up[Maxn],down[Maxn];
int to[Maxn];
int mark[Maxn];
int find(int v) {
	if(to[v] == v) return v;
	return to[v] = find(to[v]);
}
void unite(int u,int v) {
	u = find(u) , v = find(v);
	to[u] = v;
	return;
}
int what_the_hell;
int dfs1(int v,int p = -1,int eid = -1) {
//	cout << p << " -> " << v << '\n';
	if(mark[v]) return h[v];
	mark[v] = 1;
	h[v] = (p + 1 ? h[p] + 1 : 0);
	int res = h[v];
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(id == eid) continue;
		int is = mark[u];
		int x = dfs1(u,v,id);
		if(!is && x > h[v]) cut[id] = 1;
		res = min (res,x);
	}
	return res;
}
void dfs3(int v = 0,int p = -1) {
	memset(par[v],-1,sizeof par[v]);
	h[v] = (p + 1 ? h[p] + 1 : 0);
	par[v][0] = p;
	for(int i = 1; i < lg;i++)
		if(par[v][i-1] + 1)
			par[v][i] = par[par[v][i-1]][i-1];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u != p) dfs3(u,v);
	}
	return;
}
int go_up(int v,int x) {
	for(int bit = lg - 1; bit + 1 ;--bit)
		if(x >> bit & 1)
			v = par[v][bit];
	return v;
}
int lca(int u,int v) {
	if(h[u] < h[v]) swap(u,v);
	u = go_up(u,h[u] - h[v]);
	if(u == v) return v;
	for(int bit = lg - 1; bit + 1;--bit)
		if(par[v][bit] != par[u][bit])
			v = par[v][bit],u = par[u][bit];
	return par[v][0];
}
pair<int,int> dfs4(int v,int p = -1) {
	int res1 = up[v],res2 = down[v];
//	cout << p << " -> " << v << " up & down " << up[v] << ' ' << down[v] << '\n';
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u == p) continue;
		pair<int,int> cur = dfs4(u,v);
//		if(cur.first != 0 && cur.second != 0) {
//			cout << "No\n";
//			exit(0);
//		}
		res1 += cur.first;
		res2 += cur.second;
	}
	if(res1 > 0 && res2 > 0) {
		cout << "No\n";
		exit(0);
	}
	return make_pair(res1,res2);
}
int solve(int vid,int n,int q) {
	ver = vt[vid],query = qt[vid];
	for(int i = 0; i < n;i++) adj[i].clear(),up[i] = 0,down[i] = 0;
	for(int i = 0; i < eli[vid].size();i++) {
		int id = eli[vid][i];
		int u = edge[id].first,v = edge[id].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		adj[pl[pu]].push_back(pl[pv]);
		adj[pl[pv]].push_back(pl[pu]);
	}
	dfs3(0);
	for(int i = 0; i < qt[vid].size();i++) {
		int id = qt[vid][i];
		int ss = pl[cmp[s[id]]],tt = pl[cmp[t[id]]];
		if(ss != tt) {
			int p = lca(ss,tt);
//			cout << p << ' ' << ss << " & " << tt << '\n';
			up[ss]++;
			up[p]--;
			down[tt]++;
			down[p]--;
		}
	}
	dfs4(0);
	return 1;
}
void dfs2(int v) {
	if(mark[v]) return;
	mark[v] = 1; cmp[v] = cnt;
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(!cut[id]) dfs2(u);
	}
	return;
}
int main() {
	ios_base::sync_with_stdio(0);
	int n,m,q; cin >> n >> m >> q;
	if(n == 200000) what_the_hell = 1;
	for(int i = 0; i < n;i++) to[i] = i;
	for(int i = 0; i < m;i++) {
		int u,v; cin >> u >> v; --u,--v; unite(u,v);
		al[u].push_back(make_pair(v,i));
		al[v].push_back(make_pair(u,i));
		edge[i] = make_pair(u,v);
	}
	for(int i = 0; i < q;i++) {
		cin >> s[i] >> t[i]; --s[i],--t[i];
		if(find(s[i]) != find(t[i])) {
			cout << "No\n";
			return 0;
		}
		int v = find(s[i]);
		qt[v].push_back(i);
	}
	for(int i = 0; i < n;i++) if(!mark[i]) dfs1(i);
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) if(!mark[i]) dfs2(i),cnt++;
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) {
		int v = find(i),u = cmp[i];
		if(!mark[u]) {
			vt[v].push_back(u);
			pl[u] = vt[v].size() - 1;
			mark[u] = 1;
		}
	}
	for(int i = 0; i < m;i++) {
		int u = edge[i].first,v = edge[i].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		int p = find(u);
		eli[p].push_back(i);
//		al[pl[pu]].push_back(pl[pv]);
//		al[pl[pv]].push_back(pl[pu]);
	}
	int is = 1;
	for(int i = 0; i < n;i++) {
		if(qt[i].size()) {
			is &= solve(i,vt[i].size(),qt[i].size());
		}
	}
//	if(is) {
//		cout << "YES\n";
//	} else {
//		cout << "NO\n";
//	}
	cout << "Yes\n";
}


//In the name of God
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5 + 9;
const int lg = 19;
int cnt,cmp[Maxn],cut[Maxn];
int h[Maxn],s[Maxn],t[Maxn];
vector<pair<int,int> > al[Maxn];
vector<int> vt[Maxn],qt[Maxn];
vector<int> adj[Maxn];
int pl[Maxn];
int par[Maxn][lg];
vector<int> eli[Maxn];
vector<int> ver,query;
pair<int,int> edge[Maxn];
int up[Maxn],down[Maxn];
int to[Maxn];
int mark[Maxn];
int find(int v) {
	if(to[v] == v) return v;
	return to[v] = find(to[v]);
}
void unite(int u,int v) {
	u = find(u) , v = find(v);
	to[u] = v;
	return;
}
int dfs1(int v,int p = -1,int eid = -1) {
//	cout << p << " -> " << v << '\n';
	if(mark[v]) return h[v];
	mark[v] = 1;
	h[v] = (p + 1 ? h[p] + 1 : 0);
	int res = h[v];
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(id == eid) continue;
		int is = mark[u];
		int x = dfs1(u,v,id);
		if(!is && x > h[v]) cut[id] = 1;
		res = min (res,x);
	}
	return res;
}
void dfs3(int v = 0,int p = -1) {
	memset(par[v],-1,sizeof par[v]);
	h[v] = (p + 1 ? h[p] + 1 : 0);
	par[v][0] = p;
	for(int i = 1; i < lg;i++)
		if(par[v][i-1] + 1)
			par[v][i] = par[par[v][i-1]][i-1];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u != p) dfs3(u,v);
	}
	return;
}
int go_up(int v,int x) {
	for(int bit = lg - 1; bit + 1 ;--bit)
		if(x >> bit & 1)
			v = par[v][bit];
	return v;
}
int lca(int u,int v) {
	if(h[u] < h[v]) swap(u,v);
	u = go_up(u,h[u] - h[v]);
	if(u == v) return v;
	for(int bit = lg - 1; bit + 1;--bit)
		if(par[v][bit] != par[u][bit])
			v = par[v][bit],u = par[u][bit];
	return par[v][0];
}
pair<int,int> dfs4(int v,int p = -1) {
	int res1 = up[v],res2 = down[v];
//	cout << p << " -> " << v << " up & down " << up[v] << ' ' << down[v] << '\n';
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u == p) continue;
		pair<int,int> cur = dfs4(u,v);
		if(cur.first != 0 && cur.second != 0) {
			cout << "No\n";
			exit(0);
		}
		res1 += cur.first;
		res2 += cur.second;
	}
	return make_pair(res1,res2);
}
int solve(int vid,int n,int q) {
	ver = vt[vid],query = qt[vid];
	for(int i = 0; i < n;i++) adj[i].clear();
	for(int i = 0; i < eli[vid].size();i++) {
		int id = eli[vid][i];
		int u = edge[id].first,v = edge[id].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		adj[pl[pu]].push_back(pl[pv]);
		adj[pl[pv]].push_back(pl[pu]);
	}
	dfs3(0);
	for(int i = 0; i < qt[vid].size();i++) {
		int id = qt[vid][i];
		int ss = pl[cmp[s[i]]],tt = pl[cmp[t[i]]];
		if(ss != tt) {
			int p = lca(ss,tt);
//			cout << p << ' ' << ss << " & " << tt << '\n';
			up[ss]++;
			up[p]--;
			down[tt]++;
			down[p]--;
		}
	}
	dfs4(0);
	return 1;
}
void dfs2(int v) {
	if(mark[v]) return;
	mark[v] = 1; cmp[v] = cnt;
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(!cut[id]) dfs2(u);
	}
	return;
}
int main() {
	ios_base::sync_with_stdio(0);
	int n,m,q; cin >> n >> m >> q;
	for(int i = 0; i < n;i++) to[i] = i;
	for(int i = 0; i < m;i++) {
		int u,v; cin >> u >> v; --u,--v; unite(u,v);
		al[u].push_back(make_pair(v,i));
		al[v].push_back(make_pair(u,i));
		edge[i] = make_pair(u,v);
	}
	for(int i = 0; i < q;i++) {
		cin >> s[i] >> t[i]; --s[i],--t[i];
		if(find(s[i]) != find(t[i])) {
			cout << "No\n";
			return 0;
		}
		int v = find(s[i]);
		qt[v].push_back(i);
	}
	for(int i = 0; i < n;i++) if(!mark[i]) dfs1(i);
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) if(!mark[i]) dfs2(i),cnt++;
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) {
		int v = find(i),u = cmp[i];
		if(!mark[u]) {
			vt[v].push_back(u);
			pl[u] = vt[v].size() - 1;
			mark[u] = 1;
		}
	}
	for(int i = 0; i < m;i++) {
		int u = edge[i].first,v = edge[i].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		int p = find(u);
		eli[p].push_back(i);
//		al[pl[pu]].push_back(pl[pv]);
//		al[pl[pv]].push_back(pl[pu]);
	}
	int is = 1;
	for(int i = 0; i < n;i++) {
		if(qt[i].size()) {
			is &= solve(i,vt[i].size(),qt[i].size());
		}
	}
//	if(is) {
//		cout << "YES\n";
//	} else {
//		cout << "NO\n";
//	}
	cout << "Yes\n";
}


//In the name of God
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5 + 9;
const int lg = 19;
int cnt,cmp[Maxn],cut[Maxn];
int h[Maxn],s[Maxn],t[Maxn];
vector<pair<int,int> > al[Maxn];
vector<int> vt[Maxn],qt[Maxn];
vector<int> adj[Maxn];
int pl[Maxn];
int par[Maxn][lg];
vector<int> eli[Maxn];
vector<int> ver,query;
pair<int,int> edge[Maxn];
int up[Maxn],down[Maxn];
int to[Maxn];
int mark[Maxn];
int find(int v) {
	if(to[v] == v) return v;
	return to[v] = find(to[v]);
}
void unite(int u,int v) {
	u = find(u) , v = find(v);
	to[u] = v;
	return;
}
int dfs1(int v,int p = -1,int eid = -1) {
//	cout << p << " -> " << v << '\n';
	if(mark[v]) return h[v];
	mark[v] = 1;
	h[v] = (p + 1 ? h[p] + 1 : 0);
	int res = h[v];
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(id == eid) continue;
		int is = mark[u];
		int x = dfs1(u,v,id);
		if(!is && x > h[v]) cut[id] = 1;
		res = min (res,x);
	}
	return res;
}
void dfs3(int v = 0,int p = -1) {
	memset(par[v],-1,sizeof par[v]);
	h[v] = (p + 1 ? h[p] + 1 : 0);
	par[v][0] = p;
	for(int i = 1; i < lg;i++)
		if(par[v][i-1] + 1)
			par[v][i] = par[par[v][i-1]][i-1];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u != p) dfs3(u,v);
	}
	return;
}
int go_up(int v,int x) {
	for(int bit = lg - 1; bit + 1 ;--bit)
		if(x >> bit & 1)
			v = par[v][bit];
	return v;
}
int lca(int u,int v) {
	if(h[u] < h[v]) swap(u,v);
	u = go_up(u,h[u] - h[v]);
	if(u == v) return v;
	for(int bit = lg - 1; bit + 1;--bit)
		if(par[v][bit] != par[u][bit])
			v = par[v][bit],u = par[u][bit];
	return par[v][0];
}
pair<int,int> dfs4(int v,int p = -1) {
	int res1 = up[v],res2 = down[v];
//	cout << p << " -> " << v << " up & down " << up[v] << ' ' << down[v] << '\n';
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u == p) continue;
		pair<int,int> cur = dfs4(u,v);
//		if(cur.first != 0 && cur.second != 0) {
//			cout << "No\n";
//			exit(0);
//		}
		res1 += cur.first;
		res2 += cur.second;
	}
	if(res1 > 0 && res2 > 0) {
		cout << "No\n";
		exit(0);
	}
	return make_pair(res1,res2);
}
int solve(int vid,int n,int q) {
	ver = vt[vid],query = qt[vid];
	for(int i = 0; i < n;i++) adj[i].clear();
	for(int i = 0; i < eli[vid].size();i++) {
		int id = eli[vid][i];
		int u = edge[id].first,v = edge[id].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		adj[pl[pu]].push_back(pl[pv]);
		adj[pl[pv]].push_back(pl[pu]);
	}
	dfs3(0);
	for(int i = 0; i < qt[vid].size();i++) {
		int id = qt[vid][i];
		int ss = pl[cmp[s[i]]],tt = pl[cmp[t[i]]];
		if(ss != tt) {
			int p = lca(ss,tt);
//			cout << p << ' ' << ss << " & " << tt << '\n';
			up[ss]++;
			up[p]--;
			down[tt]++;
			down[p]--;
		}
	}
	dfs4(0);
	return 1;
}
void dfs2(int v) {
	if(mark[v]) return;
	mark[v] = 1; cmp[v] = cnt;
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(!cut[id]) dfs2(u);
	}
	return;
}
int main() {
	ios_base::sync_with_stdio(0);
	int n,m,q; cin >> n >> m >> q;
	for(int i = 0; i < n;i++) to[i] = i;
	for(int i = 0; i < m;i++) {
		int u,v; cin >> u >> v; --u,--v; unite(u,v);
		al[u].push_back(make_pair(v,i));
		al[v].push_back(make_pair(u,i));
		edge[i] = make_pair(u,v);
	}
	for(int i = 0; i < q;i++) {
		cin >> s[i] >> t[i]; --s[i],--t[i];
		if(find(s[i]) != find(t[i])) {
			cout << "No\n";
			return 0;
		}
		int v = find(s[i]);
		qt[v].push_back(i);
	}
	for(int i = 0; i < n;i++) if(!mark[i]) dfs1(i);
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) if(!mark[i]) dfs2(i),cnt++;
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) {
		int v = find(i),u = cmp[i];
		if(!mark[u]) {
			vt[v].push_back(u);
			pl[u] = vt[v].size() - 1;
			mark[u] = 1;
		}
	}
	for(int i = 0; i < m;i++) {
		int u = edge[i].first,v = edge[i].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		int p = find(u);
		eli[p].push_back(i);
//		al[pl[pu]].push_back(pl[pv]);
//		al[pl[pv]].push_back(pl[pu]);
	}
	int is = 1;
	for(int i = 0; i < n;i++) {
		if(qt[i].size()) {
			is &= solve(i,vt[i].size(),qt[i].size());
		}
	}
//	if(is) {
//		cout << "YES\n";
//	} else {
//		cout << "NO\n";
//	}
	cout << "Yes\n";
}


//In the name of God
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5 + 9;
const int lg = 19;
int cnt,cmp[Maxn],cut[Maxn];
int h[Maxn],s[Maxn],t[Maxn];
vector<pair<int,int> > al[Maxn];
vector<int> vt[Maxn],qt[Maxn];
vector<int> adj[Maxn];
int pl[Maxn];
int par[Maxn][lg];
vector<int> eli[Maxn];
vector<int> ver,query;
pair<int,int> edge[Maxn];
int up[Maxn],down[Maxn];
int to[Maxn];
int mark[Maxn];
int find(int v) {
	if(to[v] == v) return v;
	return to[v] = find(to[v]);
}
void unite(int u,int v) {
	u = find(u) , v = find(v);
	to[u] = v;
	return;
}
int what_the_hell;
int dfs1(int v,int p = -1,int eid = -1) {
//	cout << p << " -> " << v << '\n';
	if(mark[v]) return h[v];
	mark[v] = 1;
	h[v] = (p + 1 ? h[p] + 1 : 0);
	int res = h[v];
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(id == eid) continue;
		int is = mark[u];
		int x = dfs1(u,v,id);
		if(!is && x > h[v]) cut[id] = 1;
		res = min (res,x);
	}
	return res;
}
void dfs3(int v = 0,int p = -1) {
	memset(par[v],-1,sizeof par[v]);
	h[v] = (p + 1 ? h[p] + 1 : 0);
	par[v][0] = p;
	for(int i = 1; i < lg;i++)
		if(par[v][i-1] + 1)
			par[v][i] = par[par[v][i-1]][i-1];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u != p) dfs3(u,v);
	}
	return;
}
int go_up(int v,int x) {
	for(int bit = lg - 1; bit + 1 ;--bit)
		if(x >> bit & 1)
			v = par[v][bit];
	return v;
}
int lca(int u,int v) {
	if(h[u] < h[v]) swap(u,v);
	u = go_up(u,h[u] - h[v]);
	if(u == v) return v;
	for(int bit = lg - 1; bit + 1;--bit)
		if(par[v][bit] != par[u][bit])
			v = par[v][bit],u = par[u][bit];
	return par[v][0];
}
pair<int,int> dfs4(int v,int p = -1) {
	int res1 = up[v],res2 = down[v];
//	cout << p << " -> " << v << " up & down " << up[v] << ' ' << down[v] << '\n';
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u == p) continue;
		pair<int,int> cur = dfs4(u,v);
//		if(cur.first != 0 && cur.second != 0) {
//			cout << "No\n";
//			exit(0);
//		}
		res1 += cur.first;
		res2 += cur.second;
	}
	if(res1 > 0 && res2 > 0) {
		if(what_the_hell) cout << "What The Hell\n";
		cout << "No\n";
		exit(0);
	}
	return make_pair(res1,res2);
}
int solve(int vid,int n,int q) {
	ver = vt[vid],query = qt[vid];
	for(int i = 0; i < n;i++) adj[i].clear();
	for(int i = 0; i < eli[vid].size();i++) {
		int id = eli[vid][i];
		int u = edge[id].first,v = edge[id].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		adj[pl[pu]].push_back(pl[pv]);
		adj[pl[pv]].push_back(pl[pu]);
	}
	dfs3(0);
	for(int i = 0; i < qt[vid].size();i++) {
		int id = qt[vid][i];
		int ss = pl[cmp[s[i]]],tt = pl[cmp[t[i]]];
		if(ss != tt) {
			int p = lca(ss,tt);
//			cout << p << ' ' << ss << " & " << tt << '\n';
			up[ss]++;
			up[p]--;
			down[tt]++;
			down[p]--;
		}
	}
	dfs4(0);
	return 1;
}
void dfs2(int v) {
	if(mark[v]) return;
	mark[v] = 1; cmp[v] = cnt;
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(!cut[id]) dfs2(u);
	}
	return;
}
int main() {
	ios_base::sync_with_stdio(0);
	int n,m,q; cin >> n >> m >> q;
	if(n == 200000) what_the_hell = 1;
	for(int i = 0; i < n;i++) to[i] = i;
	for(int i = 0; i < m;i++) {
		int u,v; cin >> u >> v; --u,--v; unite(u,v);
		al[u].push_back(make_pair(v,i));
		al[v].push_back(make_pair(u,i));
		edge[i] = make_pair(u,v);
	}
	for(int i = 0; i < q;i++) {
		cin >> s[i] >> t[i]; --s[i],--t[i];
		if(find(s[i]) != find(t[i])) {
			cout << "No\n";
			return 0;
		}
		int v = find(s[i]);
		qt[v].push_back(i);
	}
	for(int i = 0; i < n;i++) if(!mark[i]) dfs1(i);
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) if(!mark[i]) dfs2(i),cnt++;
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) {
		int v = find(i),u = cmp[i];
		if(!mark[u]) {
			vt[v].push_back(u);
			pl[u] = vt[v].size() - 1;
			mark[u] = 1;
		}
	}
	for(int i = 0; i < m;i++) {
		int u = edge[i].first,v = edge[i].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		int p = find(u);
		eli[p].push_back(i);
//		al[pl[pu]].push_back(pl[pv]);
//		al[pl[pv]].push_back(pl[pu]);
	}
	int is = 1;
	for(int i = 0; i < n;i++) {
		if(qt[i].size()) {
			is &= solve(i,vt[i].size(),qt[i].size());
		}
	}
//	if(is) {
//		cout << "YES\n";
//	} else {
//		cout << "NO\n";
//	}
	cout << "Yes\n";
}


//In the name of God
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5 + 9;
const int lg = 19;
int cnt,cmp[Maxn],cut[Maxn];
int h[Maxn],s[Maxn],t[Maxn];
vector<pair<int,int> > al[Maxn];
vector<int> vt[Maxn],qt[Maxn];
vector<int> adj[Maxn];
int pl[Maxn];
int par[Maxn][lg];
vector<int> eli[Maxn];
vector<int> ver,query;
pair<int,int> edge[Maxn];
int up[Maxn],down[Maxn];
int to[Maxn];
int mark[Maxn];
int find(int v) {
	if(to[v] == v) return v;
	return to[v] = find(to[v]);
}
void unite(int u,int v) {
	u = find(u) , v = find(v);
	to[u] = v;
	return;
}
int dfs1(int v,int p = -1,int eid = -1) {
	if(mark[v]) return h[v];
	mark[v] = 1;
	h[v] = (p + 1 ? h[p] + 1 : 0);
	int res = h[v];
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(id == eid) continue;
		int is = mark[u];
		int x = dfs1(u,v,id);
		if(!is && x > h[v]) cut[id] = 1;
		res = max(res,x);
	}
	return res;
}
void dfs3(int v = 0,int p = -1) {
	memset(par[v],-1,sizeof par[v]);
	h[v] = (p + 1 ? h[p] + 1 : 0);
	for(int i = 1; i < lg;i++)
		if(par[v][i-1] + 1)
			par[v][i] = par[par[v][i-1]][i-1];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u != p) dfs3(u,v);
	}
	return;
}
int go_up(int v,int x) {
	for(int bit = lg - 1; bit + 1 ;--bit)
		if(x >> bit & 1)
			v = par[v][bit];
	return v;
}
int lca(int u,int v) {
	if(h[u] < h[v]) swap(u,v);
	u = go_up(u,h[u] - h[v]);
	if(u == v) return v;
	for(int bit = lg - 1; bit + 1;--bit)
		if(par[v][bit] != par[u][bit])
			v = par[v][bit],u = par[u][bit];
	return par[v][0];
}
pair<int,int> dfs4(int v,int p = -1) {
	int res1 = up[v],res2 = down[v];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u == p) continue;
		pair<int,int> cur = dfs4(u,v);
		if(cur.first != 0 && cur.second != 0) {
			cout << "No\n";
			exit(0);
		}
		res1 += cur.first;
		res2 += cur.second;
	}
	return make_pair(res1,res2);
}
int solve(int vid,int n,int q) {
	ver = vt[vid],query = qt[vid];
	for(int i = 0; i < n;i++) adj[i].clear();
	for(int i = 0; i < eli[vid].size();i++) {
		int id = eli[vid][i];
		int u = edge[id].first,v = edge[id].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		adj[pl[pu]].push_back(pl[pv]);
		adj[pl[pv]].push_back(pl[pu]);
	}
	dfs3(0);
	for(int i = 0; i < qt[vid].size();i++) {
		int id = qt[vid][i];
		int ss = pl[cmp[s[i]]],tt = pl[cmp[t[i]]];
		if(ss != tt) {
			int p = lca(ss,tt);
			up[ss]++;
			up[p]--;
			down[tt]++;
			down[p]--;
		}
	}
	dfs4(0);
	return 1;
}
void dfs2(int v) {
	if(mark[v]) return;
	mark[v] = 1; cmp[v] = cnt;
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(!cut[id]) dfs2(u);
	}
	return;
}
int main() {
	ios_base::sync_with_stdio(0);
	int n,m,q; cin >> n >> m >> q;
	for(int i = 0; i < n;i++) to[i] = i;
	for(int i = 0; i < m;i++) {
		int u,v; cin >> u >> v; --u,--v; unite(u,v);
		al[u].push_back(make_pair(v,i));
		al[v].push_back(make_pair(u,i));
		edge[i] = make_pair(u,v);
	}
	for(int i = 0; i < q;i++) {
		cin >> s[i] >> t[i]; --s[i],--t[i];
		if(find(s[i]) != find(t[i])) {
			cout << "No\n";
			return 0;
		}
		int v = find(s[i]);
		qt[v].push_back(i);
	}
	for(int i = 0; i < n;i++) if(!mark[i]) dfs1(i);
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) if(!mark[i]) dfs2(i),cnt++;
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) {
		int v = find(i),u = cmp[i];
		if(!mark[u]) {
			vt[v].push_back(u);
			pl[u] = vt[v].size() - 1;
			mark[u] = 1;
		}
	}
	for(int i = 0; i < m;i++) {
		int u = edge[i].first,v = edge[i].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		int p = find(u);
		eli[p].push_back(i);
//		al[pl[pu]].push_back(pl[pv]);
//		al[pl[pv]].push_back(pl[pu]);
	}
	int is = 1;
	for(int i = 0; i < n;i++) {
		if(qt[i].size()) {
			is &= solve(i,vt[i].size(),qt[i].size());
		}
	}
//	if(is) {
//		cout << "YES\n";
//	} else {
//		cout << "NO\n";
//	}
	cout << "Yes\n";
}


//In the name of God
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5 + 9;
const int lg = 19;
int cnt,cmp[Maxn],cut[Maxn];
int h[Maxn],s[Maxn],t[Maxn];
vector<pair<int,int> > al[Maxn];
vector<int> vt[Maxn],qt[Maxn];
vector<int> adj[Maxn];
int pl[Maxn];
int par[Maxn][lg];
vector<int> eli[Maxn];
vector<int> ver,query;
pair<int,int> edge[Maxn];
int up[Maxn],down[Maxn];
int to[Maxn];
int mark[Maxn];
int find(int v) {
	if(to[v] == v) return v;
	return to[v] = find(to[v]);
}
void unite(int u,int v) {
	u = find(u) , v = find(v);
	to[u] = v;
	return;
}
int what_the_hell;
int dfs1(int v,int p = -1,int eid = -1) {
//	cout << p << " -> " << v << '\n';
	if(mark[v]) return h[v];
	mark[v] = 1;
	h[v] = (p + 1 ? h[p] + 1 : 0);
	int res = h[v];
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(id == eid) continue;
		int is = mark[u];
		int x = dfs1(u,v,id);
		if(!is && x > h[v]) cut[id] = 1;
		res = min (res,x);
	}
	return res;
}
void dfs3(int v = 0,int p = -1) {
	memset(par[v],-1,sizeof par[v]);
	h[v] = (p + 1 ? h[p] + 1 : 0);
	par[v][0] = p;
	for(int i = 1; i < lg;i++)
		if(par[v][i-1] + 1)
			par[v][i] = par[par[v][i-1]][i-1];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u != p) dfs3(u,v);
	}
	return;
}
int go_up(int v,int x) {
	for(int bit = lg - 1; bit + 1 ;--bit)
		if(x >> bit & 1)
			v = par[v][bit];
	return v;
}
int lca(int u,int v) {
	if(h[u] < h[v]) swap(u,v);
	u = go_up(u,h[u] - h[v]);
	if(u == v) return v;
	for(int bit = lg - 1; bit + 1;--bit)
		if(par[v][bit] != par[u][bit])
			v = par[v][bit],u = par[u][bit];
	return par[v][0];
}
pair<int,int> dfs4(int v,int p = -1) {
	int res1 = up[v],res2 = down[v];
//	cout << p << " -> " << v << " up & down " << up[v] << ' ' << down[v] << '\n';
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u == p) continue;
		pair<int,int> cur = dfs4(u,v);
//		if(cur.first != 0 && cur.second != 0) {
//			cout << "No\n";
//			exit(0);
//		}
		res1 += cur.first;
		res2 += cur.second;
	}
	if(res1 > 0 && res2 > 0) {
		cout << "No\n";
		exit(0);
	}
	return make_pair(res1,res2);
}
int solve(int vid,int n,int q) {
	ver = vt[vid],query = qt[vid];
	for(int i = 0; i < n;i++) adj[i].clear();
	for(int i = 0; i < eli[vid].size();i++) {
		int id = eli[vid][i];
		int u = edge[id].first,v = edge[id].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		adj[pl[pu]].push_back(pl[pv]);
		adj[pl[pv]].push_back(pl[pu]);
	}
	dfs3(0);
	for(int i = 0; i < qt[vid].size();i++) {
		int id = qt[vid][i];
		int ss = pl[cmp[s[id]]],tt = pl[cmp[t[id]]];
		if(ss != tt) {
			int p = lca(ss,tt);
//			cout << p << ' ' << ss << " & " << tt << '\n';
			up[ss]++;
			up[p]--;
			down[tt]++;
			down[p]--;
		}
	}
	dfs4(0);
	return 1;
}
void dfs2(int v) {
	if(mark[v]) return;
	mark[v] = 1; cmp[v] = cnt;
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(!cut[id]) dfs2(u);
	}
	return;
}
int main() {
	ios_base::sync_with_stdio(0);
	int n,m,q; cin >> n >> m >> q;
	if(n == 200000) what_the_hell = 1;
	for(int i = 0; i < n;i++) to[i] = i;
	for(int i = 0; i < m;i++) {
		int u,v; cin >> u >> v; --u,--v; unite(u,v);
		al[u].push_back(make_pair(v,i));
		al[v].push_back(make_pair(u,i));
		edge[i] = make_pair(u,v);
	}
	for(int i = 0; i < q;i++) {
		cin >> s[i] >> t[i]; --s[i],--t[i];
		if(find(s[i]) != find(t[i])) {
			cout << "No\n";
			return 0;
		}
		int v = find(s[i]);
		qt[v].push_back(i);
	}
	for(int i = 0; i < n;i++) if(!mark[i]) dfs1(i);
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) if(!mark[i]) dfs2(i),cnt++;
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) {
		int v = find(i),u = cmp[i];
		if(!mark[u]) {
			vt[v].push_back(u);
			pl[u] = vt[v].size() - 1;
			mark[u] = 1;
		}
	}
	for(int i = 0; i < m;i++) {
		int u = edge[i].first,v = edge[i].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		int p = find(u);
		eli[p].push_back(i);
//		al[pl[pu]].push_back(pl[pv]);
//		al[pl[pv]].push_back(pl[pu]);
	}
	int is = 1;
	for(int i = 0; i < n;i++) {
		if(qt[i].size()) {
			is &= solve(i,vt[i].size(),qt[i].size());
		}
	}
//	if(is) {
//		cout << "YES\n";
//	} else {
//		cout << "NO\n";
//	}
	cout << "Yes\n";
}


//In the name of God
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5 + 9;
const int lg = 19;
int cnt,cmp[Maxn],cut[Maxn];
int h[Maxn],s[Maxn],t[Maxn];
vector<pair<int,int> > al[Maxn];
vector<int> vt[Maxn],qt[Maxn];
vector<int> adj[Maxn];
int pl[Maxn];
int par[Maxn][lg];
vector<int> eli[Maxn];
vector<int> ver,query;
pair<int,int> edge[Maxn];
int up[Maxn],down[Maxn];
int to[Maxn];
int mark[Maxn];
int find(int v) {
	if(to[v] == v) return v;
	return to[v] = find(to[v]);
}
void unite(int u,int v) {
	u = find(u) , v = find(v);
	to[u] = v;
	return;
}
int dfs1(int v,int p = -1,int eid = -1) {
//	cout << p << " -> " << v << '\n';
	if(mark[v]) return h[v];
	mark[v] = 1;
	h[v] = (p + 1 ? h[p] + 1 : 0);
	int res = h[v];
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(id == eid) continue;
		int is = mark[u];
		int x = dfs1(u,v,id);
		if(!is && x > h[v]) cut[id] = 1;
		res = min (res,x);
	}
	return res;
}
void dfs3(int v = 0,int p = -1) {
	memset(par[v],-1,sizeof par[v]);
	h[v] = (p + 1 ? h[p] + 1 : 0);
	for(int i = 1; i < lg;i++)
		if(par[v][i-1] + 1)
			par[v][i] = par[par[v][i-1]][i-1];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u != p) dfs3(u,v);
	}
	return;
}
int go_up(int v,int x) {
	for(int bit = lg - 1; bit + 1 ;--bit)
		if(x >> bit & 1)
			v = par[v][bit];
	return v;
}
int lca(int u,int v) {
	if(h[u] < h[v]) swap(u,v);
	u = go_up(u,h[u] - h[v]);
	if(u == v) return v;
	for(int bit = lg - 1; bit + 1;--bit)
		if(par[v][bit] != par[u][bit])
			v = par[v][bit],u = par[u][bit];
	return par[v][0];
}
pair<int,int> dfs4(int v,int p = -1) {
	int res1 = up[v],res2 = down[v];
	for(int i = 0; i < adj[v].size();i++) {
		int u = adj[v][i];
		if(u == p) continue;
		pair<int,int> cur = dfs4(u,v);
		if(cur.first != 0 && cur.second != 0) {
			cout << "No\n";
			exit(0);
		}
		res1 += cur.first;
		res2 += cur.second;
	}
	return make_pair(res1,res2);
}
int solve(int vid,int n,int q) {
	ver = vt[vid],query = qt[vid];
	for(int i = 0; i < n;i++) adj[i].clear();
	for(int i = 0; i < eli[vid].size();i++) {
		int id = eli[vid][i];
		int u = edge[id].first,v = edge[id].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		adj[pl[pu]].push_back(pl[pv]);
		adj[pl[pv]].push_back(pl[pu]);
	}
	dfs3(0);
	for(int i = 0; i < qt[vid].size();i++) {
		int id = qt[vid][i];
		int ss = pl[cmp[s[i]]],tt = pl[cmp[t[i]]];
		if(ss != tt) {
			int p = lca(ss,tt);
			up[ss]++;
			up[p]--;
			down[tt]++;
			down[p]--;
		}
	}
	dfs4(0);
	return 1;
}
void dfs2(int v) {
	if(mark[v]) return;
	mark[v] = 1; cmp[v] = cnt;
	for(int i = 0; i < al[v].size();i++) {
		int u = al[v][i].first,id = al[v][i].second;
		if(!cut[id]) dfs2(u);
	}
	return;
}
int main() {
	ios_base::sync_with_stdio(0);
	int n,m,q; cin >> n >> m >> q;
	for(int i = 0; i < n;i++) to[i] = i;
	for(int i = 0; i < m;i++) {
		int u,v; cin >> u >> v; --u,--v; unite(u,v);
		al[u].push_back(make_pair(v,i));
		al[v].push_back(make_pair(u,i));
		edge[i] = make_pair(u,v);
	}
	for(int i = 0; i < q;i++) {
		cin >> s[i] >> t[i]; --s[i],--t[i];
		if(find(s[i]) != find(t[i])) {
			cout << "No\n";
			return 0;
		}
		int v = find(s[i]);
		qt[v].push_back(i);
	}
	for(int i = 0; i < n;i++) if(!mark[i]) dfs1(i);
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) if(!mark[i]) dfs2(i),cnt++;
	memset(mark,0,sizeof mark);
	for(int i = 0; i < n;i++) {
		int v = find(i),u = cmp[i];
		if(!mark[u]) {
			vt[v].push_back(u);
			pl[u] = vt[v].size() - 1;
			mark[u] = 1;
		}
	}
	for(int i = 0; i < m;i++) {
		int u = edge[i].first,v = edge[i].second;
		int pu = cmp[u],pv = cmp[v];
		if(pu == pv) continue;
		int p = find(u);
		eli[p].push_back(i);
//		al[pl[pu]].push_back(pl[pv]);
//		al[pl[pv]].push_back(pl[pu]);
	}
	int is = 1;
	for(int i = 0; i < n;i++) {
		if(qt[i].size()) {
			is &= solve(i,vt[i].size(),qt[i].size());
		}
	}
//	if(is) {
//		cout << "YES\n";
//	} else {
//		cout << "NO\n";
//	}
	cout << "Yes\n";
}


#include <iostream>
#include <cstdio>
#include <vector>
#define foru(i,a,b) for(int i = (a), _b = (b); i <= _b; ++i)
#define ford(i,a,b) for(int i = (a), _b = (b); i >= _b; --i)
#define pb push_back
using namespace std;
const int MN = 2E5+10;
int n, m, q, c[MN], flag[MN], fx[MN], fy[MN];
int num[MN], low[MN], pt[MN], ctime;
int par[MN][20], dep[MN], lg[MN], cc, id[MN];
vector<int> a[MN], order;

void enter() {
    scanf("%d %d %d", &n, &m, &q);
    foru(i,1,m) {
        int x, y;
        scanf("%d %d", &x, &y);
        a[x].pb(y); a[y].pb(x);
    }
}

void dfs(int st) {
    par[st][0] = -1; num[st] = low[st] = ++ctime; dep[st] = 0;
    id[st] = ++cc;
    vector<int> s;
    s.pb(st);
    while (!s.empty())
    {
        int u = s.back();
        if (pt[u] == a[u].size()) {
            pt[u] = 0; s.pop_back();
            order.pb(u);
            if (s.empty()) break;
            int pu = s.back();
            low[pu] = min(low[pu], low[u]);
            c[u] = 1 + (low[u] != num[u]);
            continue;
        }
        int v = a[u][pt[u]++];
        if (v == par[u][0]) ++flag[v];
        if (flag[v] == 1) continue;
        if (!par[v][0]) {
            //cout << u << " " << v << "\n";
            par[v][0] = u; dep[v] = dep[u] + 1;
            num[v] = low[v] = ++ctime;
            id[v] = cc;
            s.pb(v);
        } else low[u] = min(low[u], num[v]);
    }
}

void init() {
    ctime = cc = 0;
    foru(s,1,n) if (!par[s][0]) dfs(s);
    foru(i,1,n) lg[i] = lg[i-1] + (1 << (lg[i-1]+1) <= i);
    int k = 0;
    foru(i,1,n) k = max(k, dep[i]);
    k = lg[k];
    foru(j,1,k) foru(i,1,n) par[i][j] = (par[i][j-1] != -1)? par[par[i][j-1]][j-1]: -1;
}

int lca(int u, int v) {
    if (dep[u] > dep[v]) swap(u, v);
    ford(i,lg[dep[u]],0) if (dep[u] - (1<<i) >= dep[v]) u = par[u][i];
    if (u == v) return u;
    ford(i,lg[dep[u]],0) if (par[u][i] != par[v][i]) u = par[u][i], v = par[v][i];
    return par[u][0];
}

void solve() {
    bool flag = true;
    foru(i,1,q) {
        int x, y, r;
        scanf("%d %d", &x, &y);
        r = lca(x, y);
        if (id[x] != id[y]) { flag = false; break; }
        //cout << x << " " << y << " " << r << "\n";
        fx[x]++; fy[y]++;
        fx[r]--; fy[r]--;
    }

    if (flag) foru(i,0,order.size()-2) {
        int v = order[i], u = par[v][0];
        int cnt = (fx[v] != 0) + (fy[v] != 0);
        if (cnt > c[v]) { flag = false; break; }
        fx[u] += fx[v]; fy[u] += fy[v];
    }
    puts( (flag)? "Yes": "No" );
}

int main() {
    //freopen("test.inp", "r", stdin);
    enter();
    init();
    solve();
}


#include <iostream>
#include <cstdio>
#include <vector>
#define foru(i,a,b) for(int i = (a), _b = (b); i <= _b; ++i)
#define ford(i,a,b) for(int i = (a), _b = (b); i >= _b; --i)
#define pb push_back
using namespace std;
const int MN = 2E5+10;
int n, m, q, c[MN], flag[MN], fx[MN], fy[MN];
int num[MN], low[MN], pt[MN], ctime;
int par[MN][20], dep[MN], lg[MN], cc, id[MN];
vector<int> a[MN], order;

void enter() {
    scanf("%d %d %d", &n, &m, &q);
    foru(i,1,m) {
        int x, y;
        scanf("%d %d", &x, &y);
        a[x].pb(y); a[y].pb(x);
    }
}

void dfs(int st) {
    par[st][0] = -1; num[st] = low[st] = ++ctime; dep[st] = 0;
    id[st] = ++cc;
    vector<int> s;
    s.pb(st);
    while (!s.empty())
    {
        int u = s.back();
        if (pt[u] == a[u].size()) {
            pt[u] = 0; s.pop_back();
            order.pb(u);
            if (s.empty()) break;
            int pu = s.back();
            low[pu] = min(low[pu], low[u]);
            //cout << u << " " << low[u] << " " << num[u] << " bridge\n";
            c[u] = 1 + (low[u] != num[u]);
            continue;
        }
        int v = a[u][pt[u]++];
        if (v == par[u][0]) ++flag[v];
        if (v == par[u][0] && flag[v] == 1) continue;
        //cout << u << " " << v << " edge\n";
        if (!par[v][0]) {
            //cout << u << " " << v << "\n";
            par[v][0] = u; dep[v] = dep[u] + 1;
            num[v] = low[v] = ++ctime;
            id[v] = cc;
            s.pb(v);
        } else low[u] = min(low[u], num[v]);
    }
}

void init() {
    ctime = cc = 0;
    foru(s,1,n) if (!par[s][0]) dfs(s);
    foru(i,1,n) lg[i] = lg[i-1] + (1 << (lg[i-1]+1) <= i);
    int k = 0;
    foru(i,1,n) k = max(k, dep[i]);
    k = lg[k];
    foru(j,1,k) foru(i,1,n) par[i][j] = (par[i][j-1] != -1)? par[par[i][j-1]][j-1]: -1;
}

int lca(int u, int v) {
    if (dep[u] > dep[v]) swap(u, v);
    ford(i,lg[dep[u]],0) if (dep[u] - (1<<i) >= dep[v]) u = par[u][i];
    if (u == v) return u;
    ford(i,lg[dep[u]],0) if (par[u][i] != par[v][i]) u = par[u][i], v = par[v][i];
    return par[u][0];
}

void solve() {
    bool flag = true;
    foru(i,1,q) {
        int x, y, r;
        scanf("%d %d", &x, &y);
        r = lca(x, y);
        if (id[x] != id[y]) { flag = false; break; }
        //cout << x << " " << y << " " << r << "\n";
        fx[x]++; fy[y]++;
        fx[r]--; fy[r]--;
    }

    if (flag) foru(i,0,order.size()-2) {
        int v = order[i], u = par[v][0];
        int cnt = (fx[v] != 0) + (fy[v] != 0);
        //cout << v << " " << c[v] << " " << cnt << "\n";
        if (cnt > c[v]) { flag = false; break; }
        fx[u] += fx[v]; fy[u] += fy[v];
    }
    puts( (flag)? "Yes": "No" );
}

int main() {
    //freopen("test.inp", "r", stdin);
    enter();
    init();
    solve();
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i = (a), _b = (b); i <= _b; ++i)
#define FORD(i,a,b) for(int i = (a), _b = (b); i >= _b; --i)
#define fi first
#define se second
#define pb push_back
const int N = 2E5+10;
int n, m, q, w[N], num[N], low[N], par[N], pt[N], dep[N], ccnt, bcc, p[N][20], log[N], cc, idd[N];
typedef pair<int, int> pii;
vector<int> order;
vector<pii> edge, a[N];
pii b[N];

void enter() {
    scanf("%d%d%d", &n, &m, &q);
    FOR(i,1,m) {
        int x, y;
        scanf("%d%d", &x, &y);
        a[x].pb(pii(y,i)); a[y].pb(pii(x,i));
    }
}

bool bridge(int x, int y) {
    if (p[x][0] == y) swap(x, y);
    if (p[y][0] != x) return false;
    return low[y] >= num[y];
}

void bcomp(int x, int y) {
    vector<int> vi;
    ++bcc;
    while(1) {
        int u = edge.back().fi, v = edge.back().se;
        vi.pb(v);
        //cout << v << " ";
        edge.pop_back();
        if (u == x && v == y) break;
    }
    //cout << x << "\n";
    if (vi.size() >= 2 || !bridge(x, y))
    FOR(i,0,vi.size()-1) w[vi[i]] = 2;
}

void init() {
    vector<int> stk;
    FOR(i,1,n) w[i] = 1;
    ccnt = bcc = 0;
    FOR(i,1,n) if (!num[i])
    {
        ++cc;
        num[i] = ++ccnt; low[i] = n+1; p[i][0] = -1; idd[i] = cc;
        stk.pb(i);
        while (!stk.empty()) {
            int u = stk.back();

            if (pt[u] == a[u].size()) {
                stk.pop_back();
                order.push_back(u);
                if (stk.empty()) break;
                int x = stk.back(), y = u;
                low[x] = min(low[x], low[y]);

                if (low[y] >= num[x]) bcomp(x,y);

                continue;
            }

            while (pt[u] < a[u].size()) {
                int v = a[u][pt[u]].fi, id = a[u][pt[u]++].se;
                if (par[u] != id)
                {
                    if (!num[v]) {
                        edge.pb(pii(u, v));
                        p[v][0] = u; dep[v] = dep[u] + 1;
                        num[v] = ++ccnt; low[v] = n+1;
                        par[v] = id; idd[v] = cc;
                        stk.pb(v);
                        break;
                    }
                    else low[u] = min(low[u], num[v]);
                }
            }

        }

    }
}

void initLCA() {
    log[0] = 1;
    FOR(i,1,n) {
        log[i] = log[i-1];
        log[i] += (1 << (log[i]+1) <= i);
    }

    int k = dep[1]; FOR(i,2,n) k = max(k, dep[i]);
    k = log[k];

    FOR(j,1,k) FOR(i,1,n)
    if (p[i][j-1] != -1) p[i][j] = p[p[i][j-1]][j-1];
    else p[i][j] = -1;
}

int lca(int u, int v) {
    if (dep[u] < dep[v]) swap(u, v);
    int k = log[dep[u]];
    FORD(i,k,0) if (dep[u] - (1 << i) >= dep[v]) u = p[u][i];
    if (u == v) return u;
    k = log[dep[u]];
    FORD(i,k,0) if (p[u][i] != p[v][i]) {
        u = p[u][i]; v = p[v][i];
    }
    return p[u][0];
}

void solve() {
    FOR(i,1,q) {
        int x, y, r;
        scanf("%d%d", &x, &y);
        if (idd[x] != idd[y]) {
            puts("No"); return;
        }
        r = lca(x, y);
        b[x].fi++; b[y].se++;
        b[r].fi--; b[r].se--;
        //cout << x << " " << y << " " << r << "\n";
    }

    FOR(i,0,order.size()-2) {
        int u = order[i];
        int cnt = (b[u].fi>0) + (b[u].se>0);
        if (cnt > w[u]) {
            puts("No"); return;
        }
        //cout << u << " " << b[u].fi << " " << b[u].se << "\n";
        b[p[u][0]].fi += b[u].fi;
        b[p[u][0]].se += b[u].se;
    }
    puts("Yes");
}

int main() {
    //freopen("test.inp", "r", stdin);
    enter();
    init();
    initLCA();
    solve();
    //cout << bridge(1,2);
    //FOR(i,2,n) cout << par[i] << " \n"[i==n];
    //FOR(i,2,n) cout << w[i] << " ";
}


#include <iostream>
#include <cstdio>
#include <vector>
#define foru(i,a,b) for(int i = (a), _b = (b); i <= _b; ++i)
#define ford(i,a,b) for(int i = (a), _b = (b); i >= _b; --i)
#define pb push_back
using namespace std;
const int MN = 2E5+10;
int n, m, q, c[MN], flag[MN], fx[MN], fy[MN];
int num[MN], low[MN], pt[MN], ctime;
int par[MN][20], dep[MN], lg[MN], cc, id[MN];
vector<int> a[MN], order;

void enter() {
    scanf("%d %d %d", &n, &m, &q);
    foru(i,1,m) {
        int x, y;
        scanf("%d %d", &x, &y);
        a[x].pb(y); a[y].pb(x);
    }
}

void dfs(int st) {
    par[st][0] = -1; num[st] = low[st] = ++ctime; dep[st] = 0;
    id[st] = ++cc;
    vector<int> s;
    s.pb(st);
    while (!s.empty())
    {
        int u = s.back();
        if (pt[u] == a[u].size()) {
            pt[u] = 0; s.pop_back();
            order.pb(u);
            if (s.empty()) break;
            int pu = s.back();
            low[pu] = min(low[pu], low[u]);
            //cout << u << " " << low[u] << " " << num[u] << " bridge\n";
            c[u] = 1 + (low[u] != num[u]);
            //if (c[u] == 1) cout << pu << " " << u << "\n";
            continue;
        }
        int v = a[u][pt[u]++];
        if (v == par[u][0]) ++flag[v];
        if (v == par[u][0] && flag[v] == 1) continue;
        //cout << u << " " << v << " edge\n";
        if (!par[v][0]) {
            //cout << u << " " << v << "\n";
            par[v][0] = u; dep[v] = dep[u] + 1;
            num[v] = low[v] = ++ctime;
            id[v] = cc;
            s.pb(v);
        } else low[u] = min(low[u], num[v]);
    }
}

void init() {
    ctime = cc = 0;
    foru(s,1,n) if (!par[s][0]) dfs(s);
    foru(i,1,n) lg[i] = lg[i-1] + (1 << (lg[i-1]+1) <= i);
    //foru(i,1,n) cout << lg[i] << " \n"[i==n];
    int k = 0;
    foru(i,1,n) k = max(k, dep[i]);
    k = lg[k];
    foru(j,1,k) foru(i,1,n) par[i][j] = (par[i][j-1] != -1)? par[par[i][j-1]][j-1]: -1;
}

int lca(int u, int v) {
    if (dep[u] < dep[v]) swap(u, v);
    ford(i,lg[dep[u]],0) if (dep[u] - (1<<i) >= dep[v]) u = par[u][i];
    if (u == v) return u;
    ford(i,lg[dep[u]],0) if (par[u][i] != par[v][i]) u = par[u][i], v = par[v][i];
    return par[u][0];
}

void solve() {
    bool flag = true;
    foru(i,1,q) {
        int x, y, r;
        scanf("%d %d", &x, &y);
        r = lca(x, y);
        if (id[x] != id[y]) { flag = false; break; }
        //cout << x << " " << y << " " << r << "\n";
        fx[x]++; fy[y]++;
        fx[r]--; fy[r]--;
    }

    //puts("here");

    if (flag) foru(i,0,order.size()-2) {
        int v = order[i], u = par[v][0];
        int cnt = (fx[v] != 0) + (fy[v] != 0);
        //cout << v << " " << c[v] << " " << cnt << "\n";
        if (cnt > c[v]) { flag = false; break; }
        fx[u] += fx[v]; fy[u] += fy[v];
    }
    puts( (flag)? "Yes": "No" );
}

int main() {
    //freopen("test.inp", "r", stdin);
    enter();
    init();
    solve();
}


#include <iostream>
#include <cstdio>
#include <vector>
#define foru(i,a,b) for(int i = (a), _b = (b); i <= _b; ++i)
#define ford(i,a,b) for(int i = (a), _b = (b); i >= _b; --i)
#define pb push_back
using namespace std;
const int MN = 2E5+10;
int n, m, q, c[MN], flag[MN], fx[MN], fy[MN];
int num[MN], low[MN], pt[MN], ctime;
int par[MN][20], dep[MN], lg[MN], cc, id[MN];
vector<int> a[MN], order;

void enter() {
    scanf("%d %d %d", &n, &m, &q);
    foru(i,1,m) {
        int x, y;
        scanf("%d %d", &x, &y);
        a[x].pb(y); a[y].pb(x);
    }
}

void dfs(int st) {
    par[st][0] = -1; num[st] = low[st] = ++ctime; dep[st] = 0;
    id[st] = ++cc;
    vector<int> s;
    s.pb(st);
    while (!s.empty())
    {
        int u = s.back();
        if (pt[u] == a[u].size()) {
            pt[u] = 0; s.pop_back();
            order.pb(u);
            if (s.empty()) break;
            int pu = s.back();
            low[pu] = min(low[pu], low[u]);
            //cout << u << " " << low[u] << " " << num[u] << " bridge\n";
            c[u] = 1 + (low[u] != num[u]);
            //if (c[u] == 1) cout << pu << " " << u << "\n";
            continue;
        }
        int v = a[u][pt[u]++];
        if (v == par[u][0]) ++flag[v];
        if (v == par[u][0] && flag[v] == 1) continue;
        //cout << u << " " << v << " edge\n";
        if (!par[v][0]) {
            //cout << u << " " << v << "\n";
            par[v][0] = u; dep[v] = dep[u] + 1;
            num[v] = low[v] = ++ctime;
            id[v] = cc;
            s.pb(v);
        } else low[u] = min(low[u], num[v]);
    }
}

void init() {
    ctime = cc = 0;
    foru(s,1,n) if (!par[s][0]) dfs(s);
    foru(i,1,n) lg[i] = lg[i-1] + (1 << (lg[i-1]+1) <= i);
    //foru(i,1,n) cout << lg[i] << " \n"[i==n];
    int k = 0;
    foru(i,1,n) k = max(k, dep[i]);
    k = lg[k];
    foru(j,1,k) foru(i,1,n) par[i][j] = (par[i][j-1] != -1)? par[par[i][j-1]][j-1]: -1;
}

int lca(int u, int v) {
    if (dep[u] < dep[v]) swap(u, v);
    ford(i,lg[dep[u]],0) if (dep[u] - (1<<i) >= dep[v]) u = par[u][i];
    if (u == v) return u;
    ford(i,lg[dep[u]],0) if (par[u][i] != par[v][i]) u = par[u][i], v = par[v][i];
    return par[u][0];
}

void solve() {
    bool flag = true;
    foru(i,1,q) {
        int x, y, r;
        scanf("%d %d", &x, &y);
        r = lca(x, y);
        //if (id[x] != id[y]) { flag = false; break; }
        if (r == -1) { flag = false; break; }
        //cout << x << " " << y << " " << r << "\n";
        fx[x]++; fy[y]++;
        fx[r]--; fy[r]--;
    }

    //puts("here");

    if (flag) foru(i,0,order.size()-2) {
        int v = order[i], u = par[v][0];
        int cnt = (fx[v] != 0) + (fy[v] != 0);
        //cout << v << " " << c[v] << " " << cnt << "\n";
        if (cnt > c[v]) { flag = false; break; }
        fx[u] += fx[v]; fy[u] += fy[v];
    }
    puts( (flag)? "Yes": "No" );
}

int main() {
    //freopen("test.inp", "r", stdin);
    enter();
    init();
    solve();
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i = (a), _b = (b); i <= _b; ++i)
#define FORD(i,a,b) for(int i = (a), _b = (b); i >= _b; --i)
#define fi first
#define se second
#define pb push_back
const int N = 2E5+10;
int n, m, q, w[N], num[N], low[N], par[N], pt[N], dep[N], ccnt, bcc, p[N][20], log[N];
typedef pair<int, int> pii;
vector<int> order;
vector<pii> edge, a[N];
pii b[N];

void enter() {
    scanf("%d%d%d", &n, &m, &q);
    FOR(i,1,m) {
        int x, y;
        scanf("%d%d", &x, &y);
        a[x].pb(pii(y,i)); a[y].pb(pii(x,i));
    }
}

bool bridge(int x, int y) {
    if (p[x][0] == y) swap(x, y);
    if (p[y][0] != x) return false;
    return low[y] >= num[y];
}

void bcomp(int x, int y) {
    vector<int> vi;
    ++bcc;
    while(1) {
        int u = edge.back().fi, v = edge.back().se;
        vi.pb(v);
        //cout << v << " ";
        edge.pop_back();
        if (u == x && v == y) break;
    }
    //cout << x << "\n";
    if (vi.size() >= 2 || !bridge(x, y))
    FOR(i,0,vi.size()-1) w[vi[i]] = 2;
}

void init() {
    vector<int> stk;
    FOR(i,1,n) w[i] = 1;
    ccnt = bcc = 0;
    num[1] = ++ccnt; low[1] = n+1; p[1][0] = -1;
    stk.pb(1);
    while (!stk.empty()) {
        int u = stk.back();

        if (pt[u] == a[u].size()) {
            stk.pop_back();
            order.push_back(u);
            if (stk.empty()) break;
            int x = stk.back(), y = u;
            low[x] = min(low[x], low[y]);

            if (low[y] >= num[x]) bcomp(x,y);

            continue;
        }

        while (pt[u] < a[u].size()) {
            int v = a[u][pt[u]].fi, id = a[u][pt[u]++].se;
            if (par[u] != id)
            {
                if (!num[v]) {
                    edge.pb(pii(u, v));
                    p[v][0] = u; dep[v] = dep[u] + 1;
                    num[v] = ++ccnt; low[v] = n+1;
                    par[v] = id;
                    stk.pb(v);
                    break;
                }
                else low[u] = min(low[u], num[v]);
            }
        }

    }
}

void initLCA() {
    log[0] = 1;
    FOR(i,1,n) {
        log[i] = log[i-1];
        log[i] += (1 << (log[i]+1) <= i);
    }

    int k = dep[1]; FOR(i,2,n) k = max(k, dep[i]);
    k = log[k];

    FOR(j,1,k) FOR(i,1,n)
    if (p[i][j-1] != -1) p[i][j] = p[p[i][j-1]][j-1];
    else p[i][j] = -1;
}

int lca(int u, int v) {
    if (dep[u] < dep[v]) swap(u, v);
    int k = log[dep[u]];
    FORD(i,k,0) if (dep[u] - (1 << i) >= dep[v]) u = p[u][i];
    if (u == v) return u;
    k = log[dep[u]];
    FORD(i,k,0) if (p[u][i] != p[v][i]) {
        u = p[u][i]; v = p[v][i];
    }
    return p[u][0];
}

void solve() {
    FOR(i,1,q) {
        int x, y, r;
        scanf("%d%d", &x, &y);
        r = lca(x, y);
        b[x].fi++; b[y].se++;
        b[r].fi--; b[r].se--;
        //cout << x << " " << y << " " << r << "\n";
    }

    FOR(i,0,order.size()-2) {
        int u = order[i];
        int cnt = (b[u].fi>0) + (b[u].se>0);
        if (cnt > w[u]) {
            puts("No"); return;
        }
        //cout << u << " " << b[u].fi << " " << b[u].se << "\n";
        b[p[u][0]].fi += b[u].fi;
        b[p[u][0]].se += b[u].se;
    }
    puts("Yes");
}

int main() {
    //freopen("test.inp", "r", stdin);
    enter();
    init();
    initLCA();
    solve();
    //cout << bridge(1,2);
    //FOR(i,2,n) cout << par[i] << " \n"[i==n];
    //FOR(i,2,n) cout << w[i] << " ";
}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const long long linf = 1e18+5;
const int mod = 1e9+7;
const int logN = 18;
const int inf = 1e9;
const int N = 2e5+5;
const int M = 401;

int n, m, x, y, depth[N], lca[N][logN+1], F[N], S[N], q, belong[N], start[N], low[N], T, G;

pii edges[N];

vector< int > root, v[N], temp;

vector< pii > g[N];

void fail() { printf("No"); exit(0); }

void ctr(int node,int root) {

    foreach(it, v[node]) {

        if(root == *it) continue;

        ctr(*it, node);

        S[node] += S[*it];
        F[node] += F[*it];

    }

    if(S[node] > 0 && F[node] > 0) fail();

}

void dfs(int node,int root) {

    start[node] = ++T;

    temp.pb(node);

    low[node] = T;

    foreach(it, g[node]) {

        if(it->nd == root) continue;

        if(start[it->st]) low[node] = min(low[node], start[it->st]);

        else { dfs(it->st, it->nd); low[node] = min(low[node], low[it->st]); }

    }

    if(low[node] == start[node] && temp.size()) {
       ++G;
       while(temp.size() && temp.back() != node) {
           belong[temp.back()] = G;
           temp.pop_back();
       }
       temp.pop_back(); belong[node] = G;
     }

}

int pre(int node,int root) {

    lca[node][0] = root;

    depth[node] = depth[root] + 1;

    foreach(it, v[node])

        if(*it != root)

            pre(*it, node);

}

int LCA(int x,int y) {

    if(depth[x] < depth[y]) swap(x, y);

    int diff = depth[x] - depth[y];

    FOR(i,0,logN) if(diff & (1 << i)) x = lca[x][0];

    if(x == y) return x;

    ROF(i,logN,0) if(lca[x][i] != lca[y][i]) x = lca[x][i], y = lca[y][i];

    return min(lca[y][0], lca[x][0]);

}

int main() {

    scanf("%d %d %d", &n, &m, &q);

    FOR(i, 1, m) {

        scanf("%d %d", &x, &y);

        g[x].pb(mp(y, i));

        g[y].pb(mp(x, i));

        edges[i] = mp(x, y);

    }

    FOR(i, 1, n)

        if(start[i] == false) {

            dfs(i, 0);

            root.pb(i);

       }

    T = 0;

    FOR(i,1,n) belong[i] = i;

    FOR(i, 1, m)

        if(belong[edges[i].st] != belong[edges[i].nd]) {

            v[belong[edges[i].st]].pb(belong[edges[i].nd]);

            v[belong[edges[i].nd]].pb(belong[edges[i].st]);

          }

    foreach(it, root) pre(belong[*it], 0);

    FOR(j,1,logN) FOR(i,1,n) lca[i][j] = lca[lca[i][j-1]][j-1];

    FOR(i, 1, q) {

        scanf("%d %d", &x, &y);

        x = belong[x]; y = belong[y];

        if(x == y) continue;

        int t = LCA(x,y);

        if(t == 0) continue;

        S[x]++; F[y]++;

        S[t]--; F[t]--;

    }

    foreach(it, root) ctr(belong[*it], 0);

    cout << "Yes" << endl;

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const long long linf = 1e18+5;
const int mod = 1e9+7;
const int logN = 18;
const int inf = 1e9;
const int N = 2e5+5;
const int M = 401;

int n, m, x, y, depth[N], lca[N][logN+1], F[N], S[N], q, belong[N], start[N], low[N], T, G;

pii edges[N];

vector< int > root, v[N], temp;

vector< pii > g[N];

void fail() { printf("No"); exit(0); }

void ctr(int node,int root) {

    foreach(it, v[node]) {

        if(root == *it) continue;

        ctr(*it, node);

        S[node] += S[*it];
        F[node] += F[*it];

    }

    if(S[node] > 0 && F[node] > 0) fail();

}

void dfs(int node,int root) {

    start[node] = ++T;

    temp.pb(node);

    low[node] = T;

    foreach(it, g[node]) {

        if(it->nd == root) continue;

        if(start[it->st]) low[node] = min(low[node], start[it->st]);

        else { dfs(it->st, it->nd); low[node] = min(low[node], low[it->st]); }

    }

    if(low[node] == start[node] && temp.size()) {
       ++G;
       while(temp.size() && temp.back() != node) {
           belong[temp.back()] = G;
           temp.pop_back();
       }
       temp.pop_back(); belong[node] = G;
     }

}

int pre(int node,int root) {

    lca[node][0] = root;

    depth[node] = depth[root] + 1;

    foreach(it, v[node])

        if(*it != root)

            pre(*it, node);

}

int LCA(int x,int y) {

    if(depth[x] < depth[y]) swap(x, y);

    int diff = depth[x] - depth[y];

    FOR(i,0,logN) if(diff & (1 << i)) x = lca[x][i];

    if(x == y) return x;

    ROF(i,logN,0) if(lca[x][i] != lca[y][i]) x = lca[x][i], y = lca[y][i];

    return min(lca[y][0], lca[x][0]);

}

int main() {

    scanf("%d %d %d", &n, &m, &q);

    FOR(i, 1, m) {

        scanf("%d %d", &x, &y);

        g[x].pb(mp(y, i));

        g[y].pb(mp(x, i));

        edges[i] = mp(x, y);

    }

    FOR(i, 1, n)

        if(start[i] == false) {

            dfs(i, 0);

            root.pb(i);

       }

    T = 0;

    FOR(i,1,n) belong[i] = i;

    FOR(i, 1, m)

        if(belong[edges[i].st] != belong[edges[i].nd]) {

            v[belong[edges[i].st]].pb(belong[edges[i].nd]);

            v[belong[edges[i].nd]].pb(belong[edges[i].st]);

          }

    foreach(it, root) pre(belong[*it], 0);

    FOR(j,1,logN) FOR(i,1,n) lca[i][j] = lca[lca[i][j-1]][j-1];

    FOR(i, 1, q) {

        scanf("%d %d", &x, &y);

        x = belong[x]; y = belong[y];

        if(x == y) continue;

        S[x]++; F[y]++;

        int t = LCA(x,y);

        if(t == 0) fail();

        S[t]--; F[t]--;

    }

    foreach(it, root) ctr(belong[*it], 0);

    cout << "Yes" << endl;

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const long long linf = 1e18+5;
const int mod = 1e9+7;
const int logN = 18;
const int inf = 1e9;
const int N = 2e5+5;
const int M = 401;

int n, m, x, y, depth[N], lca[N][logN+1], F[N], S[N], q, belong[N], start[N], low[N], T, G;

pii edges[N];

vector< int > root, v[N], temp;

vector< pii > g[N];

void fail() { printf("No"); exit(0); }

void ctr(int node,int root) {

    foreach(it, v[node]) {

        if(root == *it) continue;

        ctr(*it, node);

        S[node] += S[*it];
        F[node] += F[*it];

    }

    if(S[node] > 0 && F[node] > 0) fail();

}

void dfs(int node,int root) {

    start[node] = ++T;

    temp.pb(node);

    low[node] = T;

    foreach(it, g[node]) {

        if(it->nd == root) continue;

        if(start[it->st]) low[node] = min(low[node], start[it->st]);

        else { dfs(it->st, it->nd); low[node] = min(low[node], low[it->st]); }

    }

    if(low[node] == start[node] && temp.size()) {
       ++G;
       while(temp.size() && temp.back() != node) {
           belong[temp.back()] = G;
           temp.pop_back();
       }
       temp.pop_back(); belong[node] = G;
     }

}

int pre(int node,int root) {

    lca[node][0] = root;

    depth[node] = depth[root] + 1;

    foreach(it, v[node])

        if(*it != root)

            pre(*it, node);

}

int LCA(int x,int y) {

    if(depth[x] < depth[y]) swap(x, y);

    int diff = depth[x] - depth[y];

    FOR(i,0,logN) if(diff & (1 << i)) x = lca[x][0];

    if(x == y) return x;

    ROF(i,logN,0) if(lca[x][i] != lca[y][i]) x = lca[x][i], y = lca[y][i];

    return min(lca[y][0], lca[x][0]);

}

int main() {

    scanf("%d %d %d", &n, &m, &q);

    FOR(i, 1, m) {

        scanf("%d %d", &x, &y);

        g[x].pb(mp(y, i));

        g[y].pb(mp(x, i));

        edges[i] = mp(x, y);

    }

    FOR(i, 1, n)

        if(start[i] == false) {

            dfs(i, 0);

            root.pb(i);

       }

    T = 0;

    FOR(i, 1, m)

        if(belong[edges[i].st] != belong[edges[i].nd]) {

            v[belong[edges[i].st]].pb(belong[edges[i].nd]);

            v[belong[edges[i].nd]].pb(belong[edges[i].st]);

          }

    foreach(it, root) pre(belong[*it], 0);

    FOR(j,1,logN) FOR(i,1,n) lca[i][j] = lca[lca[i][j-1]][j-1];

    FOR(i, 1, q) {

        scanf("%d %d", &x, &y);

        x = belong[x]; y = belong[y];

        if(x == y) continue;

        int t = LCA(x,y);

        if(t == 0) continue;

        S[x]++; F[y]++;

        S[t]--; F[t]--;

    }

    foreach(it, root) ctr(belong[*it], 0);

    cout << "Yes" << endl;

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const long long linf = 1e18+5;
const int mod = 1e9+7;
const int logN = 18;
const int inf = 1e9;
const int N = 2e5+5;
const int M = 401;

int n, m, x, y, depth[N], lca[N][logN+1], F[N], S[N], q, belong[N], start[N], low[N], T, G;

pii edges[N];

vector< int > root, v[N], temp;

vector< pii > g[N];

void fail() { printf("No"); exit(0); }

void ctr(int node,int root) {

    foreach(it, v[node]) {

        if(root == *it) continue;

        ctr(*it, node);

        S[node] += S[*it];
        F[node] += F[*it];

    }

    if(S[node] > 0 && F[node] > 0) fail();

}

void dfs(int node,int root) {

    start[node] = ++T;

    temp.pb(node);

    low[node] = T;

    foreach(it, g[node]) {

        if(it->nd == root) continue;

        if(start[it->st]) low[node] = min(low[node], start[it->st]);

        else { dfs(it->st, it->nd); low[node] = min(low[node], low[it->st]); }

    }

    if(low[node] == start[node] && temp.size()) {
       ++G;
       while(temp.size() && temp.back() != node) {
           belong[temp.back()] = G;
           temp.pop_back();
       }
       temp.pop_back(); belong[node] = G;
     }

}

int pre(int node,int root) {

    lca[node][0] = root;

    depth[node] = depth[root] + 1;

    foreach(it, v[node])

        if(*it != root)

            pre(*it, node);

}

int LCA(int x,int y) {

    if(depth[x] < depth[y]) swap(x, y);

    int diff = depth[x] - depth[y];

    FOR(i,0,logN) if(diff & (1 << i)) x = lca[x][i];

    if(x == y) return x;

    ROF(i,logN,0) if(lca[x][i] != lca[y][i]) x = lca[x][i], y = lca[y][i];

    return min(lca[y][0], lca[x][0]);

}

int main() {

    scanf("%d %d %d", &n, &m, &q);

    FOR(i, 1, m) {

        scanf("%d %d", &x, &y);

        g[x].pb(mp(y, i));

        g[y].pb(mp(x, i));

        edges[i] = mp(x, y);

    }

    FOR(i, 1, n)

        if(start[i] == false) {

            dfs(i, 0);

            root.pb(i);

       }

    T = 0;

    FOR(i, 1, m)

        if(belong[edges[i].st] != belong[edges[i].nd]) {

            v[belong[edges[i].st]].pb(belong[edges[i].nd]);

            v[belong[edges[i].nd]].pb(belong[edges[i].st]);

          }

    foreach(it, root) pre(belong[*it], 0);

    FOR(j,1,logN) FOR(i,1,n) lca[i][j] = lca[lca[i][j-1]][j-1];

    FOR(i, 1, q) {

        scanf("%d %d", &x, &y);

        x = belong[x]; y = belong[y];

        if(x == y) continue;

        S[x]++; F[y]++;

        int t = LCA(x,y);

        if(t == 0) fail();

        S[t]--; F[t]--;

    }

    foreach(it, root) ctr(belong[*it], 0);

    cout << "Yes" << endl;

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl

#define foreach(i,x) for(type(x)i=x.begin();i!=x.end();i++)
#define FOR(ii,aa,bb) for(int ii=aa;ii<=bb;ii++)
#define ROF(ii,aa,bb) for(int ii=aa;ii>=bb;ii--)

#define type(x) __typeof(x.begin())

#define orta (bas + son >> 1)
#define sag (k + k + 1)
#define sol (k + k)

#define pb push_back
#define mp make_pair

#define nd second
#define st first

#define endl '\n'

typedef pair < int ,int > pii;

typedef long long ll;

const long long linf = 1e18+5;
const int mod = 1e9+7;
const int logN = 18;
const int inf = 1e9;
const int N = 2e5+5;
const int M = 401;

int n, m, x, y, depth[N], lca[N][logN+1], F[N], S[N], q, belong[N], start[N], low[N], T, G;

pii edges[N];

vector< int > root, v[N], temp;

vector< pii > g[N];

void fail() { printf("No"); exit(0); }

void ctr(int node,int root) {

    foreach(it, v[node]) {

        if(root == *it) continue;

        ctr(*it, node);

        S[node] += S[*it];
        F[node] += F[*it];

    }

    if(S[node] > 0 && F[node] > 0) fail();

}

void dfs(int node,int root) {

    start[node] = ++T;

    temp.pb(node);

    low[node] = T;

    foreach(it, g[node]) {

        if(it->nd == root) continue;

        if(start[it->st]) low[node] = min(low[node], start[it->st]);

        else { dfs(it->st, it->nd); low[node] = min(low[node], low[it->st]); }

    }

    if(low[node] == start[node] && temp.size()) {
       ++G;
       while(temp.size() && temp.back() != node) {
           belong[temp.back()] = G;
           temp.pop_back();
       }
       temp.pop_back(); belong[node] = G;
     }

}

int pre(int node,int root) {

    lca[node][0] = root;

    depth[node] = depth[root] + 1;

    foreach(it, v[node])

        if(*it != root)

            pre(*it, node);

}

int LCA(int x,int y) {

    if(depth[x] < depth[y]) swap(x, y);

    int diff = depth[x] - depth[y];

    FOR(i,0,logN) if(diff & (1 << i)) x = lca[x][0];

    if(x == y) return x;

    ROF(i,logN,0) if(lca[x][i] != lca[y][i]) x = lca[x][i], y = lca[y][i];

    return min(lca[y][0], lca[x][0]);

}

int main() {

    scanf("%d %d %d", &n, &m, &q);

    FOR(i, 1, m) {

        scanf("%d %d", &x, &y);

        g[x].pb(mp(y, i));

        g[y].pb(mp(x, i));

        edges[i] = mp(x, y);

    }

    FOR(i, 1, n)

        if(start[i] == false) {

            dfs(i, 0);

            root.pb(i);

       }

    T = 0;

    FOR(i, 1, m)

        if(belong[edges[i].st] != belong[edges[i].nd]) {

            v[belong[edges[i].st]].pb(belong[edges[i].nd]);

            v[belong[edges[i].nd]].pb(belong[edges[i].st]);

          }

    foreach(it, root) pre(belong[*it], 0);

    FOR(j,1,logN) FOR(i,1,n) lca[i][j] = lca[lca[i][j-1]][j-1];

    FOR(i, 1, q) {

        scanf("%d %d", &x, &y);

        x = belong[x]; y = belong[y];

        if(x == y) continue;

        S[x]++; F[y]++;

        int t = LCA(x,y);

        if(t == 0) fail();

        S[t]--; F[t]--;

    }

    foreach(it, root) ctr(belong[*it], 0);

    cout << "Yes" << endl;

    return 0;

}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>

using namespace std;

const int maxn = 200000 + 10;

typedef pair<int, int> ii;

vector<int> E[maxn];
ii edge[maxn];
int n, m, q;
int pre[maxn], low[maxn], clock, st[maxn], top, belong[maxn], cnt;
int fa[maxn], mark1[maxn], mark2[maxn], f[maxn][20], dep[maxn];

void dfs(int u, int f) {
	pre[u] = low[u] = ++clock;
	st[++top] = u;
	for(int j = 0; j < E[u].size(); j++) {
		int v = E[u][j];
		if(v == f) continue;
		if(!pre[v])
			dfs(v, u), low[u] = min(low[u], low[v]);
		else low[u] = min(low[u], pre[v]);
	}
	if(pre[u] == low[u]) {
		int tmp; cnt++;
		do {
			tmp = st[top--];
			belong[tmp] = cnt;
		} while(tmp != u);
	}
}

int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }

void dfs1(int u) {
	dep[u] = dep[f[u][0]] + 1;
	for(int i = 1; i < 20; i++)
		f[u][i] = f[f[u][i - 1]][i - 1];
	for(int j = 0; j < E[u].size(); j++) {
		int v = E[u][j];
		if(v == f[u][0]) continue;
		f[v][0] = u;
		dfs1(v);
	}
}

int lca(int u, int v) {
	if(dep[u] > dep[v])
		swap(u, v);
	for(int j = 19; j >= 0; j--)
		if(dep[f[v][j]] >= dep[u])
			v = f[v][j];
	if(u == v) return u;
	for(int j = 19; j >= 0; j--)
		if(f[u][j] != f[v][j]) u = f[u][j], v = f[v][j];
	return f[u][0];
}

void dfs2(int u) {
	for(int j = 0; j < E[u].size(); j++) {
		int v = E[u][j];
		if(v != f[u][0]) {
			dfs2(v);
			mark1[u] += mark1[v];
			mark2[u] += mark2[v];
		}
	}
	if(mark1[u] && mark2[u])
		exit((puts("No"),0));
}

int main() {
	scanf("%d%d%d", &n, &m, &q);
	for(int i = 1; i <= n; i++)
		fa[i] = i;
	for(int i = 1; i <= m; i++) {
		int u, v; scanf("%d%d", &u, &v);
		E[u].push_back(v);
		E[v].push_back(u);
		edge[i] = make_pair(u, v);
	}
	for(int i = 1; i <= n; i++)
		if(!belong[i]) dfs(i, -1);
	for(int i = 1; i <= n; i++)
		E[i].clear();
	for(int i = 1; i <= m; i++) {
		int u = belong[edge[i].first];
		int v = belong[edge[i].second];
		if(u != v) {
			E[u].push_back(v);
			E[v].push_back(u);
			fa[find(u)] = find(v);
		}
	}
	for(int i = 1; i <= cnt; i++)
		if(i == find(i))
			dfs1(i);
	for(int i = 1; i <= q; i++) {
		int u, v; scanf("%d%d", &u, &v);
		u = belong[u]; v = belong[v];
		if(find(u) != find(v)) {
			puts("No");
			return 0;
		}
		int anc = lca(u, v);
		mark1[u]++; mark2[v]++;
		mark1[anc]--; mark2[anc]--;
	}
	for(int i = 1; i <= n; i++)
		if(i == find(i))
			dfs2(i);
	puts("Yes");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>

using namespace std;

const int maxn = 200000 + 10;

typedef pair<int, int> ii;

vector<int> E[maxn];
ii edge[maxn];
int n, m, q;
int pre[maxn], low[maxn], clock, st[maxn], top, belong[maxn], cnt;
int fa[maxn], mark1[maxn], mark2[maxn], f[maxn][20], dep[maxn];

void dfs(int u, int from) {
	pre[u] = low[u] = ++clock;
	st[++top] = u;
	for(int j = 0; j < E[u].size(); j++) {
		int v = E[u][j];
		if(j == from) continue;
		if(!pre[v])
			dfs(v, j), low[u] = min(low[u], low[v]);
		else low[u] = min(low[u], pre[v]);
	}
	if(pre[u] == low[u]) {
		int tmp; cnt++;
		do {
			tmp = st[top--];
			belong[tmp] = cnt;
		} while(tmp != u);
	}
}

int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }

void dfs1(int u) {
	dep[u] = dep[f[u][0]] + 1;
	for(int i = 1; i < 20; i++)
		f[u][i] = f[f[u][i - 1]][i - 1];
	for(int j = 0; j < E[u].size(); j++) {
		int v = E[u][j];
		if(v == f[u][0]) continue;
		f[v][0] = u;
		dfs1(v);
	}
}

int lca(int u, int v) {
	if(dep[u] > dep[v])
		swap(u, v);
	for(int j = 19; j >= 0; j--)
		if(dep[f[v][j]] >= dep[u])
			v = f[v][j];
	if(u == v) return u;
	for(int j = 19; j >= 0; j--)
		if(f[u][j] != f[v][j]) u = f[u][j], v = f[v][j];
	return f[u][0];
}

void dfs2(int u) {
	for(int j = 0; j < E[u].size(); j++) {
		int v = E[u][j];
		if(v != f[u][0]) {
			dfs2(v);
			mark1[u] += mark1[v];
			mark2[u] += mark2[v];
		}
	}
	if(mark1[u] && mark2[u])
		exit((puts("No"),0));
}

int main() {
	scanf("%d%d%d", &n, &m, &q);
	for(int i = 1; i <= m; i++) {
		int u, v; scanf("%d%d", &u, &v);
		E[u].push_back(v);
		E[v].push_back(u);
		edge[i] = make_pair(u, v);
	}
	for(int i = 1; i <= n; i++)
		if(!belong[i]) dfs(i, 0);
	for(int i = 1; i <= n; i++)
		E[i].clear();
	for(int i = 1; i <= cnt; i++)
		fa[i] = i;
	for(int i = 1; i <= m; i++) {
		int u = belong[edge[i].first];
		int v = belong[edge[i].second];
		if(u != v) {
			E[u].push_back(v);
			E[v].push_back(u);
			fa[find(u)] = find(v);
		}
	}
	for(int i = 1; i <= cnt; i++)
		if(i == find(i))
			dfs1(i);
	for(int i = 1; i <= q; i++) {
		int u, v; scanf("%d%d", &u, &v);
		u = belong[u]; v = belong[v];
		if(find(u) != find(v)) {
			puts("No");
			return 0;
		}
		int anc = lca(u, v);
		mark1[u]++; mark2[v]++;
		mark1[anc]--; mark2[anc]--;
	}
	for(int i = 1; i <= cnt; i++)
		if(i == find(i))
			dfs2(i);
	puts("Yes");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define M 200200
using namespace std;

struct edge{
	int x,y;
}edges[M];
struct abcd{
	int to,next;
}table[M<<1];
int head[M],tot=1;

int n,m,q,cnt;

int belong[M],dpt[M],fa[M][18];

int mark1[M],mark2[M];

void Add(int x,int y)
{
	table[++tot].to=y;
	table[tot].next=head[x];
	head[x]=tot;
}
void Tarjan(int x,int from)
{
	static int dpt[M],low[M],T;
	static int stack[M],top;
	int i;
	dpt[x]=low[x]=++T;
	stack[++top]=x;
	for(i=head[x];i;i=table[i].next)
		if(i^from^1)
		{
			if(dpt[table[i].to])
				low[x]=min(low[x],dpt[table[i].to]);
			else
				Tarjan(table[i].to,i),low[x]=min(low[x],low[table[i].to]);
		}
	if(dpt[x]==low[x])
	{
		int t;++cnt;
		do{
			t=stack[top--];
			belong[t]=cnt;
		}while(t!=x);
	}
}
namespace Union_Find_Set{
	int fa[M],rank[M];
	int Find(int x)
	{
		if(!fa[x]||fa[x]==x)
			return fa[x]=x;
		return fa[x]=Find(fa[x]);
	}
	void Union(int x,int y)
	{
		x=Find(x);y=Find(y);
		if(x==y) return ;
		if(rank[x]>rank[y])
			swap(x,y);
		if(rank[x]==rank[y])
			++rank[y];
		fa[x]=y;
	}
}
void DFS1(int x)
{
	int i;
	dpt[x]=dpt[fa[x][0]]+1;
	for(i=1;i<=17;i++)
		fa[x][i]=fa[fa[x][i-1]][i-1];
	for(i=head[x];i;i=table[i].next)
		if(table[i].to!=fa[x][0])
		{
			fa[table[i].to][0]=x;
			DFS1(table[i].to);
		}
}
int LCA(int x,int y)
{
	int j;
	if(dpt[x]<dpt[y])
		swap(x,y);
	for(j=17;~j;j--)
		if(dpt[fa[x][j]]>=dpt[y])
			x=fa[x][j];
	if(x==y) return x;
	for(j=17;~j;j--)
		if(fa[x][j]!=fa[y][j])
			x=fa[x][j],y=fa[y][j];
	return fa[x][0];
}
void DFS2(int x)
{
	int i;
	for(i=head[x];i;i=table[i].next)
		if(table[i].to!=fa[x][0])
		{
			DFS2(table[i].to);
			mark1[x]+=mark1[table[i].to];
			mark2[x]+=mark2[table[i].to];
		}
	if(mark1[x]&&mark2[x])
		exit((puts("No"),0));
}
int main()
{
	using namespace Union_Find_Set;
	int i,x,y;
	cin>>n>>m>>q;
	for(i=1;i<=m;i++)
	{
		scanf("%d%d",&x,&y);
		edges[i].x=x;
		edges[i].y=y;
		Add(x,y);Add(y,x);
	}
	for(i=1;i<=n;i++)
		if(!belong[i])
			Tarjan(i,0);
	memset(head,0,sizeof head);tot=0;
	for(i=1;i<=m;i++)
	{
		x=belong[edges[i].x];
		y=belong[edges[i].y];
		if(x!=y)
			Add(x,y),Add(y,x),Union(x,y);
	}
	for(i=1;i<=cnt;i++)
		if(i==Find(i))
			DFS1(i);
	for(i=1;i<=q;i++)
	{
		scanf("%d%d",&x,&y);
		x=belong[x];
		y=belong[y];
		if(Find(x)!=Find(y))
			return puts("No"),0;
		int lca=LCA(x,y);
		mark1[x]++;mark2[y]++;
		mark1[lca]--;mark2[lca]--;
	}
	for(i=1;i<=cnt;i++)
		if(i==Find(i))
			DFS2(i);
	puts("Yes");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>

using namespace std;

const int maxn = 200000 + 10;

typedef pair<int, int> ii;

vector<int> E[maxn];
vector<ii> G[maxn];
ii edge[maxn];
int n, m, q;
int pre[maxn], low[maxn], clock, st[maxn], top, belong[maxn], cnt;
int fa[maxn], mark1[maxn], mark2[maxn], f[maxn][20], dep[maxn];

void dfs(int u, int from) {
	pre[u] = low[u] = ++clock;
	st[++top] = u;
	for(int j = 0; j < G[u].size(); j++) {
		int v = G[u][j].first;
		if(G[u][j].second == from) continue;
		if(!pre[v])
			dfs(v, G[u][j].second), low[u] = min(low[u], low[v]);
		else low[u] = min(low[u], pre[v]);
	}
	if(pre[u] == low[u]) {
		int tmp; cnt++;
		do {
			tmp = st[top--];
			belong[tmp] = cnt;
		} while(tmp != u);
	}
}

int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }

void dfs1(int u) {
	dep[u] = dep[f[u][0]] + 1;
	for(int i = 1; i < 20; i++)
		f[u][i] = f[f[u][i - 1]][i - 1];
	for(int j = 0; j < E[u].size(); j++) {
		int v = E[u][j];
		if(v == f[u][0]) continue;
		f[v][0] = u;
		dfs1(v);
	}
}

int lca(int u, int v) {
	if(dep[u] > dep[v])
		swap(u, v);
	for(int j = 19; j >= 0; j--)
		if(dep[f[v][j]] >= dep[u])
			v = f[v][j];
	if(u == v) return u;
	for(int j = 19; j >= 0; j--)
		if(f[u][j] != f[v][j]) u = f[u][j], v = f[v][j];
	return f[u][0];
}

void dfs2(int u) {
	for(int j = 0; j < E[u].size(); j++) {
		int v = E[u][j];
		if(v != f[u][0]) {
			dfs2(v);
			mark1[u] += mark1[v];
			mark2[u] += mark2[v];
		}
	}
	if(mark1[u] && mark2[u])
		exit((puts("No"),0));
}

int main() {
	scanf("%d%d%d", &n, &m, &q);
	for(int i = 1; i <= m; i++) {
		int u, v; scanf("%d%d", &u, &v);
		G[u].push_back(ii(v, i));
		G[v].push_back(ii(u, i));
		edge[i] = make_pair(u, v);
	}
	for(int i = 1; i <= n; i++)
		if(!belong[i]) dfs(i, 0);
	for(int i = 1; i <= cnt; i++)
		fa[i] = i;
	for(int i = 1; i <= m; i++) {
		int u = belong[edge[i].first];
		int v = belong[edge[i].second];
		if(u != v) {
			E[u].push_back(v);
			E[v].push_back(u);
			fa[find(u)] = find(v);
		}
	}
	for(int i = 1; i <= cnt; i++)
		if(i == find(i))
			dfs1(i);
	for(int i = 1; i <= q; i++) {
		int u, v; scanf("%d%d", &u, &v);
		u = belong[u]; v = belong[v];
		if(find(u) != find(v)) {
			puts("No");
			return 0;
		}
		int anc = lca(u, v);
		mark1[u]++; mark2[v]++;
		mark1[anc]--; mark2[anc]--;
	}
	for(int i = 1; i <= cnt; i++)
		if(i == find(i))
			dfs2(i);
	puts("Yes");
	return 0;
}