import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int k = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } HashSet nums = new HashSet<>(); for (int i = 1; i < (1 << n); i++) { if (getPop(i) < k) { continue; } int sum = 0; BigInteger mul = BigInteger.valueOf(1); int x = i; for (int j = 0; j < n; j++) { if (x % 2 == 1) { sum += arr[j]; mul = mul.multiply(BigInteger.valueOf(arr[j])); } x >>= 1; } nums.add(mul); nums.add(BigInteger.valueOf(sum)); } System.out.println(nums.size()); } static int getPop(int x) { int pop = 0; while (x > 0) { pop += x % 2; x >>= 1; } return pop; } static class Number { HashMap map = new HashMap<>(); public Number(int x) { multiply(x); } public void multiply(int x) { for (int i = 2; i <= Math.sqrt(x); i++) { while (x % i == 0) { map.put(i, map.getOrDefault(i, 0) + 1); x /= i; } } if (x > 1) { map.put(x, map.getOrDefault(x, 0) + 1); } } public int hashCode() { return map.size(); } public boolean equals(Object o) { Number n = (Number)o; if (map.size() != n.map.size()) { return false; } for (int x : map.keySet()) { if (!n.map.containsKey(x) || map.get(x) != n.map.get(x)) { return false; } } return true; } public String toString() { return map.toString(); } } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }