#include <bits/stdc++.h>
using namespace std;
unordered_map<int, vector<int>> mp;
vector<int> ans;
void DFS(int x, int par) {
  for (auto y : mp[x]) {
    if (y == par) continue;
    DFS(y, x);
  }
  if (mp[x].size() == 1 && mp[x][0] == par) ans.push_back(x + 1);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    mp[a].push_back(b);
    mp[b].push_back(a);
  }
  int root = 0;
  int c = 0;
  for (int i = 0; i < n; ++i) {
    if (mp[i].size() > 2) {
      ++c;
      root = i;
    }
  }
  if (c > 1) {
    cout << "No";
    return 0;
  }
  cout << "Yes" << endl;
  DFS(root, -1);
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << root + 1 << " " << ans[i] << endl;
  }
  return 0;
}
