#include <bits/stdc++.h>
using namespace std;
int vis[100005], f, a[100005], cnt = 0;
;
vector<int> vec[100005];
void dfs2(int x) {
  vis[x] = 1;
  for (int i = 0; i < vec[x].size(); i++) {
    int y = vec[x][i];
    if (vis[y]) continue;
    if (vec[y].size() == 1) a[++cnt] = y;
    dfs2(y);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  int cnt1 = 0, f = 1;
  for (int i = 1; i <= n; i++) {
    if (vec[i].size() > 2) cnt1++;
    if (vec[i].size() > vec[f].size()) f = i;
    if (cnt1 > 1) return printf("No\n"), 0;
  }
  dfs2(f);
  if (cnt > 0) printf("Yes\n%d\n", cnt);
  for (int i = 1; i <= cnt; i++) {
    printf("%d %d\n", f, a[i]);
    if (i == cnt) return 0;
  }
  printf("No\n");
}
