using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (n, k) = (c[0], c[1]); var a = NList; var bitmax = 1 << n; var mod1 = 1_000_000_007; var mod2 = 998_244_383; var set = new HashSet(); for (var b = 1; b < bitmax; ++b) { var tmp = b; var count = 0; var sum = 0; var mul1 = 1L; var mul2 = 1L; for (var i = 0; i < n; ++i) { if (tmp % 2 == 1) { sum += a[i]; mul1 = mul1 * a[i] % mod1; mul2 = mul2 * a[i] % mod2; ++count; } tmp >>= 1; } if (count >= k) { set.Add(new Pair(sum, sum)); set.Add(new Pair(mul1, mul2)); } } WriteLine(set.Count); } class Pair { public long A; public long B; public int H; public Pair(long a, long b) { A = a; B = b; H = (int)(a * b) % 1_000_000_009; } public override bool Equals(object obj) { var b = (Pair)obj; return A == b.A && B == b.B; } public override int GetHashCode() { return H; } } }