function main (input) {
  const haiku = [5, 7, 5];
  const inputArr = input.split(' ').map((data) => {
    return Number(data);
  });
  let tempArr = inputArr;

  for (let i = 0; i < haiku.length; i++) {
    const indexOf = tempArr.indexOf(haiku[i]);
    if (indexOf >= 0) {
      tempArr.splice(indexOf, 1);
    }
  }

  return tempArr.length === 0 ? 'YES' : 'NO';
}

// console.log(main('5 5 7'));
main(require("fs").readFileSync("/dev/stdin","utf8"));
