n,m,x = map(int,input().split()) *a, = [int(i)< e^b: e ^= b if e: basis.append(e) for b in basis: if x > x^b: x ^= b print(0 if x else pow(2,n-len(basis),10**9+7))