
    Develop a function to determine if a patient's sequence of activity intensity readings from their wearable device follows a consistently increasing or decreasing pattern throughout the monitoring period. This analysis is crucial for identifying gradual changes in mobility patterns that could indicate potential fall risks or track recovery progress. The function should return true if the sequence is either consistently non-increasing or non-decreasing, and false otherwise.
    

    
def is_Monotonic(A):
    """
    Develop a function to determine if a patient's sequence of activity intensity readings from their wearable device follows a consistently increasing or decreasing pattern throughout the monitoring period. This analysis is crucial for identifying gradual changes in mobility patterns that could indicate potential fall risks or track recovery progress. The function should return true if the sequence is either consistently non-increasing or non-decreasing, and false otherwise.
    

    """
def is_Monotonic(A):
    """
    Develop a function to determine if a patient's sequence of activity intensity readings from their wearable device follows a consistently increasing or decreasing pattern throughout the monitoring period. This analysis is crucial for identifying gradual changes in mobility patterns that could indicate potential fall risks or track recovery progress. The function should return true if the sequence is either consistently non-increasing or non-decreasing, and false otherwise.
    

    """
    return all((A[i] <= A[i + 1] for i in range(len(A) - 1))) or all((A[i] >= A[i + 1] for i in range(len(A) - 1)))