export { }
let lines = '';
const reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', function (line) {
  //lines.push(line);
  lines = line
});
reader.on('close', function () {
  //console.log('lines', lines)

  const hoge = lines.split(" ")
  

  const man: number = parseInt(hoge[0])
  const woman: number = parseInt(hoge[1])

  
  

  if (woman > man) {
    console.log('YES')
  } else {
    console.log('NO')
  }

  if (woman === man + 1) {
    console.log('0')
  } else if (woman > man) {
    const surplus: number = Math.abs(woman - man) - 1
    console.log(surplus)
  } else {
    const surplus: number = Math.abs(woman - man) + 1
    console.log(surplus)
  }

});