#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int v[maxn];
int e[maxn];
int main() {
  int n, a, b;
  scanf("%d", &n);
  memset(v, 0, sizeof(v));
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    v[a]++;
    v[b]++;
  }
  int s = -1;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (v[i] >= 3) {
      if (s == -1) {
        s = i;
      } else {
        puts("No");
        return 0;
      }
    }
    if (v[i] == 1) {
      e[cnt++] = i;
    }
  }
  if (s == -1) {
    cout << "Yes" << endl;
    cout << "1" << endl;
    cout << e[0] << " " << e[1] << endl;
  } else {
    cout << "Yes" << endl;
    cout << cnt << endl;
    for (int i = 0; i < cnt; i++) {
      cout << s << " " << e[i] << endl;
    }
  }
  return 0;
}
