#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmin(T &a, T b) {
  return b < a ? (a = b, true) : false;
}
template <class T>
bool chmax(T &a, T b) {
  return b > a ? (a = b, true) : false;
}
void kout() { cerr << endl; }
template <class T, class... U>
void kout(T a, U... b) {
  cerr << a << ' ', kout(b...);
}
template <class T>
void pary(T L, T R) {
  while (L != R) cerr << *L << " \n"[++L == R];
}
const int MAXN = 100000;
int n;
int a, b;
int p;
bool flag = 1;
int deg[MAXN + 1];
vector<int> ans;
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> a >> b;
    deg[a]++, deg[b]++;
  }
  if (n == 2) {
    cout << "Yes\n1\n1 2\n";
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (deg[i] > 2) {
      if (p)
        flag = 0;
      else
        p = i;
    } else if (deg[i] == 1) {
      ans.push_back(i);
    }
  }
  if (!p) {
    for (int i = 1; i <= n; i++) {
      if (deg[i] == 2) p = i;
    }
  }
  if (!flag) {
    cout << "No\n";
  } else {
    cout << "Yes\n";
    cout << ans.size() << "\n";
    for (int i = 0; i < ans.size(); i++) {
      cout << p << " " << ans[i] << "\n";
    }
  }
}
