inputer = input()

if (inputer.count('575')) > 0:
	print("YES")
else:
	print("NO")