import datetime today = datetime.date.today() todaydetail = datetime.datetime.today() a = sum([today.day,today.day]) A = [a] i = sum([today.day,a]) c = todaydetail.hour Z = int(input()) while i <= Z: j = todaydetail.hour for a in A: if i % a == c: j = today.day break if pow(a,a) > i: break if j == c: A.append(i) i = sum([i,today.day]) A = list(map(str,A)) if str(Z) in A: print("YES") else: print("NO")