n, q = map(int,input().split()) for i in range(q): s, t = map(int,input().split()) if s == 0 and t == 2 ** n: raise Exception