import std.stdio, std.string, std.array, std.conv, std.algorithm, std.typecons, std.range, std.container, std.math, std.algorithm.searching, std.functional;

void main(){
    (readln().chomp.isHaiku?"YES":"NO").writeln();
}
auto isHaiku(string str){
    return ["5 7 5", "7 5 5", "5 5 7"].canFind(str);
}
