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 = 1 break if pow(a,2) > i: break if j == c: A.append(i) i = sum([i,1]) A = list(map(str,A)) if str(Z) in A: print("YES") else: print("NO")