#include <bits/stdc++.h>
using namespace std;
int n;
int st[1000000];
vector<int> ed;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    st[a]++;
    st[b]++;
  }
  int calc = 0;
  int top = 0;
  for (int i = 1; i <= n; i++) {
    if (st[i] > 2) {
      calc++;
      top = i;
    }
    if (st[i] == 1) {
      ed.push_back(i);
    }
  }
  if (calc == 0) {
    cout << "Yes" << endl;
    cout << 1 << endl;
    cout << ed[0] << " " << ed[1] << endl;
  } else if (calc == 1) {
    cout << "Yes" << endl;
    cout << ed.size() << endl;
    for (int i = 0; i < ed.size(); i++) {
      cout << ed[i] << " " << top << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
