Help me in solving SESO05 problem

My issue

solve this error

My code

n = int(input())

# Initialize a flag to track if the pair exists
found = False

# Process each pair
for _ in range(n):
    pair = list(map(int, input().split()))
    
    # Check if the pair contains both a and b (in any order)
    if {pair[0], pair[1]} == {a, b}:  # Use a set to check for unordered matching
        found = True
        break  # No need to continue once we find the pair

# Read the integers a and b
a, b = map(int, input().split())

# Output the result
if found:
    print("Yes")
else:
    print("No")

Learning course: Data structures & Algorithms lab
Problem Link: Miscellaneous Linear Search in Data structures & Algorithms lab