#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000001;
int s;
vector<int> lista[MAXN];
vector<pair<int, int> > ans;
int dfs(int u, int p) {
  int r = 1, cont = 0;
  for (int i = 0; i < lista[u].size(); i++) {
    int v = lista[u][i];
    if (v == p) continue;
    r = min(dfs(v, u), r);
    cont++;
  }
  if (cont > 1 && u != s) r = 0;
  if (cont == 0) ans.push_back(pair<int, int>(s, u));
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--, b--;
    lista[a].push_back(b);
    lista[b].push_back(a);
  }
  int id = 0;
  for (int i = 0; i < n; i++)
    if (lista[i].size() > 2) id = i;
  s = id;
  if (!dfs(id, -1)) {
    cout << "No" << '\n';
    return 0;
  }
  cout << "Yes" << '\n';
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first + 1 << " " << ans[i].second + 1 << '\n';
  return 0;
}
