def main(): n = input() a, b = n.count('0'), n.count('1') print('Yes' if min(a, b) == 2 else 'No') if __name__ == '__main__': main()