let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
var a=arr[0]
var b=arr[1]
var c=arr[2]
if a==5&&b==5%%c==7 {print("YES")}
else if a==5&&b==5%%c==7 {print("YES")}
else if a==5&&b==5%%c==7 {print("YES")}
else {print("NO")}