n,m = map(int,input().split()) AB = [[int(x)-1 for x in input().split()] for i in range(m)] C = list(map(int,input().split())) ans = m+1 dic = {} l,r = AB[:m//2],AB[m//2:] # print(l) # print(r) base = 0 for c in C[::-1]: base <<= 1 base |= c # print(base) ll = len(l) for b in range(1<> i & 1: count += 1 num ^= 1<> i & 1: count += 1 num ^= 1<