#include <bits/stdc++.h>
using namespace std;
int n, m, k, t, T, x, y, sum, cnt, ans, d[200005];
vector<int> v, edges[200005];
void dfs(int x, int p) {
  bool ok = true;
  for (auto y : edges[x]) {
    if (y != p) {
      dfs(y, x);
      ok = false;
    }
  }
  if (ok && p != -1) {
    v.push_back(x);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = (1); i <= (n - 1); i++) {
    cin >> x >> y;
    edges[x].push_back(y);
    edges[y].push_back(x);
    d[x]++;
    d[y]++;
  }
  t = 1;
  for (int i = (1); i <= (n); i++) {
    if (d[i] > 2) {
      cnt++;
      t = i;
    }
  }
  if (cnt > 1) {
    cout << "No\n";
    return 0;
  }
  dfs(t, -1);
  cout << "Yes\n";
  cout << v.size() << endl;
  for (auto it : v) {
    cout << t << ' ' << it << endl;
  }
  return 0;
}
