/*
 * Problem A - FYAxI - Four your information
 *
 * John Buck
 * 2019 GNY Regional
 *
 * To Build:  g++ -o fyi fyi.cpp
 *
 * Define "QUICK_AND_DIRTY" to use the shorter, more cryptic version at the end.
 * eg.  g++ -o fyi -DQUICK_AND_DIRTY fyi.cpp
 *
 */
#include <stdio.h>
#include <stdlib.h>

#ifndef QUICK_AND_DIRTY
int main(int argc, char **argv)
{
	int  n;
	char szLine[32];

	/*
	 * Read in phone number - if we get EOF, then we're done prematurely
	 */
	if(::fgets(&(szLine[0]), sizeof(szLine), stdin) != NULL){
		/*
		 * Convert to number
		 */
		n = ::atoi(&(szLine[0]));

		/*
		 * Simply print out the answer.  
		 * If the phone number divided by 10000 is 555, then it's an information
		 * request.
		 */
		::fprintf(stdout, "%s\n", ((n/10000) == 555) ? "YES" : "NO");
	}

	return(0);
}

#else

#include <iostream>
using namespace std;

int main(int argc, char **argv)
{
	int n;

	cin >> n;
	cout << (((n/10000) == 555) ? "YES" : "NO") << endl;
	return(0);
}
#endif
