import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);
//aryread!string();
//auto PS = new Tuple!(long,string)[](M);
//x[]=1;でlong[]全要素1に初期化
void main()
{
    auto abc = aryread();
    // writeln(abc);
    long cnt5;
    long cnt7;
    foreach (i; 0 .. (abc.length))
    {
        if (abc[i] == 5)
        {
            cnt5 += 1;
        }
        else if (abc[i] == 7)
        {
            cnt7 += 1;
        }
    }
    if (cnt5 == 2 && cnt7 == 1)
    {
        writeln("YES");
    }
    else
    {
        writeln("NO");
    }
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}

void arywrite(T)(T a)
{
    a.map!text.join(' ').writeln;
}
