n = input() x = [] cnt = 0 for i,c in enumerate(n): if c == "1": cnt += 1 if i == 0: x.append(c) else: if n[i-1] == c: continue else: x.append(x) if cnt == 1: print("No");exit() if cnt == 2: print("Yes");exit() elif len(x) == 1:print('No') elif len(x) == 2: print('Yes') else: print('No')