n=int(input()) if n==1: print("NO") elif n==2: print(["NO","YES"][s[0]==s[1]]) elif n==3: print(["NO","YES"][s[0]==s[1] or s[1]==s[2]]) else: print("YES")