string = "101010000111" p = set(string) s = {'0', '1'} if s == p or p == {'0'} or p == {'1'}: print("Yes") else : print("No")