print('YES' if input().find('575') != -1 else 'NO')