#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main(){
	char s[10];
	gets(s);
	int count5 = 0;
	int count7 = 0;
	for( int i = 0; i < strlen(s); i++)
		if (s[i] == '5') count5++;
		else if(s[i] == '7') count7++;
	if(count5 == 2 && count7 == 1)
		cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}