s = input() n = len(s) cnt = 0 for c in s: if c == '1': cnt += 1 if min(cnt, n-cnt) == 2: print("Yes") else: print("No")