from math import factorial N, k = map(int, input().split()) mod = 10**9+7 fac = [0]*(N+1) fac[0] = 1 for i in range(1,N+1): fac[i] = (fac[i-1]*i)%mod if k==0: res = 1 for i in range(1,N+1): res *= i res %= mod print(res) exit() a = list(map(int, input().split())) a.sort() res = 1 for i in range(k+1): if i==0: num = a[i] elif i==k: num = a[i-1]^((1<