import java.util.*; public class Main { static final int MOD = 1000000007; public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); Pop[] pops = new Pop[k + 2]; pops[0] = new Pop(0); for (int i = 1; i <= k; i++) { pops[i] = new Pop(sc.nextLong()); } pops[k + 1] = new Pop((1L << n) - 1); Arrays.sort(pops); long ans = 1; for (int i = 0; i <= k; i++) { ans *= pops[i + 1].getPop(pops[i]); ans %= MOD; } System.out.println(ans); } static class Pop implements Comparable { long value; int count; public Pop(long value) { this.value = value; while (value > 0) { count += value % 2; value /= 2; } } public int compareTo(Pop another) { return count - another.count; } public long getPop(Pop another) { if ((value & another.value) != another.value) { return 0; } return kaijo(count - another.count); } static long kaijo(long x) { if (x <= 1) { return 1; } else { return x * kaijo(x - 1) % MOD; } } } }