import std; void main() { string S = readln.chomp; string T = "575"; writeln(S.canFind(T) ? "YES" : "NO"); }