import java.io.*; import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int k = sc.nextInt(); int[] values = new int[n]; Num[] nums = new Num[n]; for (int i = 0; i < n; i++) { values[i] = sc.nextInt(); nums[i] = new Num(values[i]); } int[] dp1 = new int[1 << n]; Num[] dp2 = new Num[1 << n]; dp2[0] = new Num(0); HashSet ans = new HashSet<>(); for (int i = 1; i < (1 << n); i++) { int pop = getPop(i); for (int j = 0; j < n; j++) { if ((i & (1 << j)) == 0) { continue; } dp1[i] = dp1[i ^ (1 << j)] + values[j]; dp2[i] = dp2[i ^ (1 << j)].multiply(nums[j]); break; } if (pop >= k) { ans.add(new Num(dp1[i])); ans.add(dp2[i]); } } System.out.println(ans.size()); } static int getPop(long x) { int pop = 0; while (x > 0) { pop += x % 2; x >>= 1; } return pop; } static class Num { int[] counts = new int[1800]; public Num(int x) { for (int i = 2; i <= Math.sqrt(x); i++) { while (x % i == 0) { counts[i]++; x /= i; } } if (x > 1) { counts[x]++; } } public Num multiply(Num x) { Num ans = new Num(0); for (int i = 0; i < counts.length; i++) { ans.counts[i] = counts[i] + x.counts[i]; } return ans; } public int hashCode() { return counts[2]; } public boolean equals(Object o) { Num x = (Num)o; for (int i = 0; i < counts.length; i++) { if (counts[i] != x.counts[i]) { return false; } } return true; } public String toString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < counts.length; i++) { if (counts[i] > 0) { sb.append("[").append(i).append(":").append(counts[i]).append("]"); } } return sb.toString(); } } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }