#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define SIZE(array) (sizeof(array) / sizeof(array[0]))

long mod = 1000000007L;

auto cmp = [](pair<int, pair<int, long>> const & a, pair<int, pair<int, long>> const & b) {
	return a.second.second < b.second.second;
};


signed main() {
	string s;
	cin >> s;
	cout << (s.find("575") == string::npos ? "NO" : "YES") << endl;
}