#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
vector<int> G[MAX];
vector<pair<int, int> > V;
bool visit[MAX];
int gcnt = 0;
void dfs(int source, int node, int par) {
  if (visit[node]) {
    return;
  }
  visit[node] = 1;
  if (G[node].size() == 1) {
    V.push_back({source, node});
    return;
  }
  int cnt = 0;
  for (auto v : G[node]) {
    if (v != par) {
      cnt += 1;
      dfs(source, v, node);
    }
  }
  if (cnt > 1) {
    gcnt += 1;
  }
}
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i < N; i++) {
    int x, y;
    scanf("%d", &x);
    scanf("%d", &y);
    G[x].push_back(y);
    G[y].push_back(x);
  }
  int mx = -1, ind;
  for (int i = 1; i <= N; i++) {
    if (mx < (int)G[i].size()) {
      mx = (int)G[i].size();
      ind = i;
    }
  }
  if (N == 2) {
    cout << "Yes\n1\n1 2\n";
    return 0;
  }
  dfs(ind, ind, -1);
  if (gcnt > 1) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n" << (int)V.size() << "\n";
  for (auto v : V) {
    cout << v.first << " " << v.second << "\n";
  }
  return 0;
}
