import java.math.BigInteger fun String.toBigInteger() = BigInteger.valueOf(this.toLong()) fun main(){ val (n, k) = readLine()!!.split(" ").map{it.toInt()} val a = readLine()!!.split(" ").map{it.toBigInteger()} val ints = mutableSetOf() for(i in 1..(1 shl n)){ val indexes = mutableSetOf() for(j in 0..n-1){ if(((i shr j) and 1) == 1) indexes.add(j) } if(indexes.size < k) continue ints.add(a.filterIndexed{index, _ -> indexes.contains(index)}.reduce{s, t -> s*t}) ints.add(a.filterIndexed{index, _ -> indexes.contains(index)}.reduce{s, t -> s.add(t)}) } println(ints.size) }