def sum_search(T, x):
    l = 0
    r = (len(T) - 1)
    while (l <= r):
        if ((T[l] + T[r]) == x):
            return True
        elif ((T[l] + T[r]) > x):
            r -= 1
        else:
            l += 1
    return False
def sum_search(T, x):
    l = 0
    r = (len(T) - 1)
    while (l <= r):
        if ((T[l] + T[r]) == x):
            return True
        elif ((T[l] + T[r]) > x):
            r -= 1
        else:
            l += 1
    return False