#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::vector<std::vector<int>> adj(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    std::cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  std::vector<int> num;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() > 2) {
      num.push_back(i);
    }
  }
  if (num.size() > 1) {
    std::cout << "No\n";
    return 0;
  }
  std::vector<int> ends;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() == 1) {
      ends.push_back(i);
    }
  }
  if (num.size() == 0) {
    assert(ends.size() == 2);
    std::cout << "Yes\n";
    std::cout << 1 << "\n";
    std::cout << ends[0] + 1 << " " << ends[1] + 1 << "\n";
    return 0;
  }
  if (num.size() == 1) {
    int root = num[0];
    std::cout << "Yes\n";
    std::cout << ends.size() << "\n";
    for (int end : ends) {
      std::cout << root + 1 << " " << end + 1 << "\n";
    }
    return 0;
  }
  return 0;
}
