#include <bits/stdc++.h>
using namespace std;
template <typename T>
void _dbg(char const *s, const T &t) {
  cout << s << "=" << t << endl;
}
template <typename T, typename... TA>
void _dbg(char const *s, const T &t, const TA &...ta) {
  while (*s != ',') cout << *s++;
  cout << "=" << t << ",";
  _dbg(s + 1, ta...);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  return os << "{" << p.first << "," << p.second << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << ",";
    os << *it;
  }
  return os << "}";
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
  os << "{";
  for (auto it = mp.begin(); it != mp.end(); ++it) {
    if (it != mp.begin()) os << ",";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &s) {
  os << "{";
  for (auto it = s.begin(); it != s.end(); ++it) {
    if (it != s.begin()) os << ",";
    os << *it;
  }
  return os << "}";
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &s) {
  os << "{";
  for (auto it = s.begin(); it != s.end(); ++it) {
    if (it != s.begin()) os << ",";
    os << *it;
  }
  return os << "}";
}
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;
const int N = 1e5 + 10;
vector<int> g[N];
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  int root = 1;
  for (int v = 1; v <= n; ++v) {
    if (g[v].size() > 2) {
      root = v;
    }
  };
  vector<bool> used(n + 1);
  used[root] = true;
  vector<int> ans;
  for (int to : g[root]) {
    int v = to;
    ;
    used[v] = true;
    while (1) {
      bool ok = false;
      for (int t : g[v]) {
        ;
        if (!used[t]) {
          v = t;
          used[t] = true;
          ok = true;
          break;
        }
      }
      if (!ok) break;
    }
    ans.push_back(v);
  };
  bool ok = true;
  for (int i = 1; i <= n; ++i) ok &= used[i] == true;
  if (!ok)
    puts("No");
  else {
    puts("Yes");
    printf("%d\n", (int)ans.size());
    for (auto &it : ans) {
      printf("%d %d\n", root, it);
    }
  }
}
int main() {
  solve();
  return 0;
}
