#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v[n + 1];
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int y = 0, ma = 1;
  vector<int> e;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() > 2) {
      ma = i;
      y++;
    }
    if (v[i].size() == 1) e.push_back(i);
  }
  if (y > 1) {
    cout << "No";
    return 0;
  }
  if (y == 0) {
    cout << "Yes\n1\n";
    cout << e[0] << " " << e[1] << endl;
  } else {
    cout << "Yes\n";
    cout << e.size() << endl;
    for (int i = 0; i < e.size(); i++) {
      cout << ma << " " << e[i] << endl;
    }
  }
  return 0;
}
