import numpy as np import random np.random.seed(0) random.seed(0) A = np.random.randint(1,10,3) B = np.random.randint(1,10,3) print("A",A) print("B",B) i = random.randint(0,2) j = random.randint(0,2) A_copy = A.copy() B_copy = B.copy() A[i] = B_copy[j] B[j] = A_copy[i] print("A",A) print("B",B) if ((A[0] != A[1] != A[2]) and (A[1]==A.max() or A[1]==A.min())) and ((B[0] != B[1] != B[2]) and (B[1]==B.max() or B[1]==B.min())): print("Yes") else : print("No")