#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int N = 2e5 + 10;
const ll inf = 1e15 + 42;
vector<vector<int> > g(100007);
int flg, root, cnt;
vector<int> ans;
void dfs(int u, int par) {
  if (flg) return;
  int val = 0;
  for (int v : g[u]) {
    if (v != par) {
      val++;
      dfs(v, u);
    }
  }
  if (val == 2 && u == 1) {
    return;
  }
  if (val > 1 && cnt == 0) {
    cnt++;
    root = u;
  } else if (val > 1) {
    flg = 1;
  }
}
void dfs1(int u, int par) {
  int ok = 1;
  for (int v : g[u]) {
    if (v != par) {
      ok = 0;
      dfs1(v, u);
    }
  }
  if (ok) ans.push_back(u);
}
void testCase() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, -1);
  if (flg == 1) {
    cout << "No"
         << "\n";
    return;
  }
  if (root == 0) root = 1;
  dfs1(root, -1);
  cout << "Yes"
       << "\n";
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); i++) cout << root << " " << ans[i] << "\n";
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  testCase();
  return 0;
}
