def is_majority(arr, n, x):
    left, right = 0, n - 1
    first = -1
    while left <= right:
        mid = (left + right) // 2
        if arr[mid] >= x:
            right = mid - 1
        else:
            left = mid + 1
    if left < n and arr[left] == x:
        first = left
    else:
        return False

    check_index = first + n // 2
    return check_index < n and arr[check_index] == x