#include <bits/stdc++.h>
using namespace std;
template <typename T>
T Abs(T first) {
  return (first < 0 ? -first : first);
}
template <typename T>
T Sqr(T first) {
  return (first * first);
}
string plural(string s) {
  return (int((s).size()) && s[int((s).size()) - 1] == 'x' ? s + "en"
                                                           : s + "s");
}
const int INF = (int)1e9;
const long double EPS = 1e-12;
const long double PI = acos(-1.0);
bool Read(int &first) {
  char c, r = 0, n = 0;
  first = 0;
  for (;;) {
    c = getchar();
    if ((c < 0) && (!r)) return (0);
    if ((c == '-') && (!r))
      n = 1;
    else if ((c >= '0') && (c <= '9'))
      first = first * 10 + c - '0', r = 1;
    else if (r)
      break;
  }
  if (n) first = -first;
  return (1);
}
bool ReadLL(long long &first) {
  char c, r = 0, n = 0;
  first = 0;
  for (;;) {
    c = getchar();
    if ((c < 0) && (!r)) return (0);
    if ((c == '-') && (!r))
      n = 1;
    else if ((c >= '0') && (c <= '9'))
      first = first * 10 + c - '0', r = 1;
    else if (r)
      break;
  }
  if (n) first = -first;
  return (1);
}
vector<int> con[200005];
int rec(int i, int p) {
  int j, c;
  int ret = i;
  for (j = 0; j < int((con[i]).size()); j++)
    if ((c = con[i][j]) != p) ret = rec(c, i);
  return (ret);
}
int main() {
  if (0) freopen("in.txt", "r", stdin);
  int N, M, K;
  int i, j, k, a, b, c, first, second, z;
  Read(N);
  for (i = 0; i < N - 1; i++) {
    Read(a), Read(b);
    con[a].push_back(b);
    con[b].push_back(a);
  }
  int R = -1;
  for (i = 1; i <= N; i++)
    if (int((con[i]).size()) > 2)
      if (R < 0)
        R = i;
      else {
        printf("No\n");
        return (0);
      }
  if (R < 0) R = 1;
  printf("Yes\n");
  printf("%d\n", int((con[R]).size()));
  for (i = 0; i < int((con[R]).size()); i++)
    printf("%d %d\n", R, rec(con[R][i], R));
  return (0);
}
