//No.558 575検出するやつ

#include <iostream>
using namespace std;

int main()
{
string S;

	cin >> S;
	if( S.find( "575" ) !=-1 )
		cout << "YES" << endl;
	else
		cout << "NO" << endl;


	return 0;
}