# -*- coding: utf-8 -*- s = input() result = "NO" if s.find('575') == -1 else "YES" print(result)