def monotonic(l: list):
    if l == sorted(l) or l == sorted(l, reverse=True):
        return True
    return False
def monotonic(X: list):
    if X == sorted(X) or X == sorted(X, reverse=True):
       
        return True
    return False