from datetime import * n,a,h,m,s = map(int, input().split()) d = datetime(year=2025, month=12, day=31, hour=h, minute=m, second=s) d += timedelta(seconds=n * a) if d.year > 2025: print('Yes') else: print('No')