const main = arg => {
  const n = x => Number(x);
  const input = arg.trim().split('\n');
  const [roomCount] = input[0].split(' ').map(n);
  const inputList = input.slice(1).map(x => x.split(' '));

  let roomMap = Array.from(Array(roomCount)).map((_, i) => `${i + 1}`);
  const connected = {};

  inputList.forEach(([a, b]) => {
    connected[a] = b;

    roomMap = [
      ...roomMap.filter(x => !x.includes(a) && !x.includes(b)),
      Array.from(new Set([
        ...[...roomMap.find(x => x.includes(a))],
        ...[...roomMap.find(x => x.includes(b))],
        a,
        b,
      ])).join(''),
    ];
  });
  delete connected[1];

  if (roomMap.length === 1) {
    console.log(`Yes${Array.from(Array(roomCount - 1)).map((_, i) => `${i + 2}`).map(i => `\n${connected[i]}`).join('')}`);
  } else {
    console.log('No');
  }
};

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
