print((function (s, t) return s:find(t) ~= nil and "YES" or "NO" end)(io.stdin:read("*l"), "575"))