#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long maxn = 1e6 + 1;
#define x first
#define y second
int main() {
	int n, m, k;
	cin >> n >> m >> k;
	map<pair<int, int>, int> ribs;
	for (int i = 0; i < m + k; ++i) {
		int one, two;
		cin >> one >> two;
		one--;
		two--;
		if (one > two) {
			swap(one, two);
		}
		ribs[make_pair(one, two)]++;
	}
	vector<pair<int, int>> shit;
	vector<int> deg(n);
	for (auto &i : ribs) {
		if (i.second & 1) {
			deg[i.first.first]++;
			deg[i.first.second]++;
			shit.push_back(i.first);
		}
	}
	for (int i = 0; i < n; ++i) {
		if (deg[i] & 1) {
			cout << "NO\n";
			exit(0);
		}
	}
	vector<tuple<int, int, int>> ans;
	for (int i = 0; i < shit.size(); ++i) {
		if (shit[i].first != 0 && shit[i].second != 0) {
			ans.push_back({1, shit[i].first + 1, shit[i].second + 1});
		}
	}
	cout << "YES\n";
	cout << ans.size() << '\n';
	for (auto [x, y, z] : ans) {
		cout << x << " " << y << " " << z << '\n';
	}
}