import java.math.BigInteger; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); BigInteger[] a = new BigInteger[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextBigInteger(); } sc.close(); Set set = new HashSet<>(); int end = 1 << n; for (int i = 0; i < end; i++) { if (Integer.bitCount(i) < k) { continue; } BigInteger x = BigInteger.ZERO; BigInteger y = BigInteger.ONE; for (int j = 0; j < n; j++) { if ((i >> j & 1) == 1) { x = x.add(a[j]); y = y.multiply(a[j]); } } set.add(x); set.add(y); } System.out.println(set.size()); } }