# coding: utf-8 # Your code here! s = input() if '575' in s: print('YES') else: print('NO')