#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const int inf = 1e9;
//using ld = long double;

int main() {
    cin.tie(0)->sync_with_stdio(false);
    int n,m,k;cin>>n>>m>>k;
    vector<set<int>>a(n+1);
    for(int i=0;i<m;i++){
        int u,v;cin>>u>>v;
        a[u].insert(v);
        a[v].insert(u);
    }
    for(int i=0;i<k;i++){
        int u,v;cin>>u>>v;
        if(a[u].count(v)) a[u].erase(v),a[v].erase(u);
        else a[u].insert(v),a[v].insert(u);
    }
    for(int i=1;i<=n;i++){
        if(a[i].size()%2) {
            cout << "NO";
            return 0;
        }
    }
    cout<<"YES"<<endl;
    vector<tuple<int,int,int>>ans;
    for(int i=1;i<=n;i++) {
        while (a[i].size()){
            int u=*a[i].begin();
            a[i].erase(a[i].begin());
            a[u].erase(i);
            int v=*a[i].begin();
            a[i].erase(a[i].begin());
            a[v].erase(i);
            ans.emplace_back(i,u,v);
            if(a[u].count(v)) a[u].erase(v),a[v].erase(u);
            else a[u].insert(v),a[v].insert(u);
        }

    }
    cout<<ans.size()<<'\n';
    for(auto [i,u,v]:ans){
        cout<<i<<' '<<u<<' '<<v<<'\n';
    }
}