#include <bits/stdc++.h>
using namespace std;
vector<int> v[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  if (n == 2) {
    cout << "Yes" << '\n';
    cout << 1 << '\n';
    cout << "1 2" << '\n';
    return 0;
  }
  int c = 0, mx = 0;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() >= 3) c++;
    mx = max(mx, (int)v[i].size());
  }
  if (c >= 2) {
    cout << "No" << '\n';
    return 0;
  }
  cout << "Yes" << '\n';
  if (mx == 2) {
    cout << 1 << '\n';
    for (int i = 1; i <= n; i++) {
      if (v[i].size() == 1) cout << i << " ";
    }
    cout << '\n';
    return 0;
  }
  int amid = 0;
  vector<int> tmp;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() >= 3) amid = i;
    if (v[i].size() == 1) tmp.push_back(i);
  }
  cout << tmp.size() << '\n';
  for (int i = 0; i < tmp.size(); i++) cout << tmp[i] << " " << amid << '\n';
}
