function Main(input) {
	var lines = input.split("\n");
	var nums = lines[0].replace(/\s/g, '')
	console.log(nums.replace('5', '').replace('5', '').replace('7', '').length === 0 ? 'YES' : 'NO')
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));