#include <bits/stdc++.h>
using namespace std;
vector<int> v[100010], ans;
int idx = 1;
void dfs(int cur, int prev) {
  if ((int)v[cur].size() == 1 && cur != idx)
    ans.push_back(cur);
  else {
    for (int i = 0; i < (int)v[cur].size(); i++) {
      int j = v[cur][i];
      if (j != prev) dfs(j, cur);
    }
  }
  return;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if ((int)v[i].size() > 2) cnt++, idx = i;
  if (cnt > 1) {
    printf("No\n");
    return 0;
  }
  printf("Yes\n");
  dfs(idx, -1);
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (int)ans.size(); i++) printf("%d %d\n", idx, ans[i]);
  return 0;
}
