import sys input=lambda:sys.stdin.readline().rstrip() S=input() cnt=0 toggle=-1 prev='2' for i in S: cnt+=int(i) toggle+=(prev!=i) prev=i if cnt==1: print("No") elif cnt==2 or toggle<=1: print("Yes") else: print("No")