def is_power_of_two(n: int) -> bool:
    return n > 0 and (n & (n - 1)) == 0

def explanation(n: int):
    # Calculate the exponent x such that 2^x = n
    x = 0
    while (1 << x) < n:  # 1 << x is equivalent to 2^x
        x += 1
    return f"Explanation: 2^{x} = {1 << x} = {n}"

# Get user input
try:
    user_input = int(input("Enter an integer: "))
    result = is_power_of_two(user_input)
    print(f"Is {user_input} a power of two? {result}")
    
    if result:
        print(explanation(user_input))
except ValueError:
    print("Please enter a valid integer.")