import java.util.ArrayList; import java.util.Scanner; import java.util.TreeMap; public class Muikashirazu { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt(),k = s.nextInt(),cut = (int)(Math.pow(10, 9) + 7); if(k == 0){ long p = 1; for(int i = 1;i <= N;i++){ p *= (long)i; p %= cut; } System.out.println(p); }else{ long count = 1; TreeMap bit = new TreeMap<>(); for(int i = 0;i < k;i++){ long a = s.nextLong(); int b = bitcount(a); if(bit.containsKey(b)){ count = 0; }else{ bit.put(b, binaryString(a)); } } s.close(); //System.out.println(bit); //System.out.println(count); int n = 1; String str = "", str2; for(int i = 1;i <= bit.lastKey();i++){ str2 = bit.get(i); if(str != "" && str2 != null){ //System.out.println(str + " " + str2); ArrayList p = new ArrayList<>(); for(int j = 0;j