#include <bits/stdc++.h>
using namespace std;
long long int mod = 998244353;
long long int ceil1(long long int n, long long int k) {
  if (n % k) return n / k + 1;
  return n / k;
}
long long int pow1(long long int n, long long int k) {
  long long int ans = 1;
  while (k != 0) {
    if (k % 2) ans = (ans * n) % mod;
    n = (n * n) % mod;
    k = k / 2;
  }
  return ans;
}
bool ispal(string s) {
  long long int i = 0;
  long long int j = s.size() - 1;
  while (i < j) {
    if (s[i] != s[j]) return false;
    i++;
    j--;
  }
  return true;
}
long long int gcdd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcdd(b, a % b);
}
long long int fact(long long int n) {
  if (n == 1 || n == 0)
    return 1;
  else
    return (n * fact(n - 1)) % mod;
}
bool isprime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
vector<long long int> z(string s) {
  vector<long long int> p(s.size());
  long long int c = 0;
  for (long long int i = 1; i < s.size(); i++) {
    while (s[i] != s[c] && c != 0) c = p[c - 1];
    if (s[i] == s[c]) c++;
    p[i] = c;
  }
  return p;
}
vector<long long int> leaf;
vector<long long int> deg(2e5 + 5);
vector<vector<long long int>> g(2e5 + 5);
void dfs(long long int v, long long int p) {
  for (auto i : g[v]) {
    if (i != p) {
      deg[v]++;
      dfs(i, v);
    }
  }
  if (deg[v] == 0) leaf.push_back(v);
  return;
}
void solve() {
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n - 1; i++) {
    long long int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  long long int root = 0;
  long long int c = 0;
  for (long long int i = 0; i < n; i++) {
    if (g[i].size() > 2) {
      root = i;
      c++;
    }
  }
  if (c > 1) {
    cout << "No" << endl;
    return;
  }
  dfs(root, -1);
  cout << "Yes" << endl;
  cout << leaf.size() << endl;
  for (long long int i = 0; i < leaf.size(); i++)
    cout << root + 1 << " " << leaf[i] + 1 << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int q = 1;
  while (q--) {
    solve();
  }
  return 0;
}
