# List of known perfect numbers (the first few) perfect_numbers = {6, 28, 496, 8128, 33550336, 8589869056, 137438691328, 2305843008139952128} def is_perfect_number(N): return N in perfect_numbers # Example usage: N = int(input("Enter a number: ")) # Taking input from the user if is_perfect_number(N): print("Yes") else: print("No")