#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
template <typename T>
inline istream& operator>>(istream& i, vector<T>& v) {
  for (int j = 0; j < ((int)(v).size()); ++j) i >> v[j];
  return i;
}
template <typename T>
string join(const vector<T>& v) {
  stringstream s;
  for (int i = 0; i < ((int)(v).size()); ++i) s << ' ' << v[i];
  return s.str().substr(1);
}
template <typename T>
inline ostream& operator<<(ostream& o, const vector<T>& v) {
  if ((int)(v).size()) o << join(v);
  return o;
}
template <typename T1, typename T2>
inline istream& operator>>(istream& i, pair<T1, T2>& v) {
  return i >> v.first >> v.second;
}
template <typename T1, typename T2>
inline ostream& operator<<(ostream& o, const pair<T1, T2>& v) {
  return o << v.first << "," << v.second;
}
template <typename T>
inline long long int suma(const vector<T>& a) {
  long long int res(0);
  for (auto&& x : a) res += x;
  return res;
}
const double eps = 1e-10;
const long long int LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MX = 200005;
vector<int> to[MX];
vector<pair<int, int> > ans;
int dfs(int v, int p = -1) {
  vector<int> s;
  for (int u : to[v]) {
    if (u == p) continue;
    int r = dfs(u, v);
    if (r == -1) return -1;
    s.push_back(r);
  }
  if ((int)(s).size() == 0) return v;
  if (p != -1 && (int)(s).size() % 2 == 0) return -1;
  for (int i = 0; i + 1 < (int)(s).size(); i += 2) {
    ans.push_back(pair<int, int>(s[i], s[i + 1]));
  }
  return s.back();
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n - 1); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a;
    --b;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  if (n == 2) {
    cout << "Yes" << endl;
    cout << 1 << endl;
    cout << 1 << " " << 2 << endl;
    return 0;
  }
  vector<int> s;
  for (int i = 0; i < (n); ++i) {
    if ((int)(to[i]).size() > 2) s.push_back(i);
  }
  if ((int)(s).size() > 1) {
    puts("No");
    return 0;
  };
  if ((int)(s).size() == 0) s.push_back(0);
  int v = s[0];
  vector<int> l;
  for (int i = 0; i < (n); ++i) {
    if (i == v) continue;
    if ((int)(to[i]).size() == 1) l.push_back(i);
  }
  cout << "Yes" << endl;
  cout << (int)(l).size() << endl;
  for (int u : l) {
    printf("%d %d\n", v + 1, u + 1);
  }
  return 0;
}
