require "big" n, k = read_line.split.map(&.to_i) a = read_line.split.map(&.to_big_i) puts [0, 1].repeated_permutations(n).select { |perm| perm.sum >= k }.flat_map { |perm| b = (0...n).select { |i| perm[i] > 0 }.map { |i| a[i] } [b.sum, b.reduce(1.to_big_i) { |acc, val| acc * val }] }.uniq.size