def check(string) :
    for char in string:
        if char not in ('0', '1'):
            return False
    return True