#include <bits/stdc++.h>
using namespace std;
int n;
int deg[100005];
vector<int> v[100005];
int st;
vector<int> ans;
int dfs(int first, int prev) {
  bool b = 1;
  for (int i = 0; i < v[first].size(); i++) {
    int nxt = v[first][i];
    if (nxt == prev) continue;
    b = 0;
    dfs(nxt, first);
  }
  if (b) {
    ans.push_back(first);
  }
}
int main() {
  scanf("%d", &n);
  if (n == 2) {
    printf("Yes\n");
    printf("1\n1 2\n");
    return 0;
  }
  for (int i = 1; i <= n - 1; i++) {
    int st, ed;
    scanf("%d%d", &st, &ed);
    ++deg[st];
    ++deg[ed];
    v[st].push_back(ed);
    v[ed].push_back(st);
  }
  int cnt3 = 0;
  st = -1;
  for (int i = 1; i <= n; i++) {
    if (deg[i] >= 3) {
      ++cnt3;
      st = i;
    }
  }
  if (cnt3 > 1) {
    printf("No\n");
    return 0;
  }
  if (cnt3 == 1) {
    dfs(st, -1);
    printf("Yes\n");
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%d %d\n", st, ans[i]);
    }
  } else {
    dfs(1, -1);
    printf("Yes\n");
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%d %d\n", 1, ans[i]);
    }
  }
  return 0;
}
