from sys import stdin def fact(n): ret = 1 for i in range(2, n + 1): ret *= i return ret def komb(n, k): return fact(n) / (fact(k) * fact(n-k)) def skip(a, bit, N, K): zbyva = bit_count = a.count(bit) index = 0 while index < N and a[index] == bit: index += 1 zbyva -= 1 sum = 0 for i in range(index, N): if a[i] == bit: zbyva -= 1 if i >= K - zbyva: sum += komb(i, K - zbyva) return sum def soucet_111(a, N): same = [True] * N ret = [] pom = False for i, bit in zip(range(N-1,-1,-1), a[::-1]): ret.insert(0, not(bit ^ pom)) pom = bit or pom ret.insert(0, pom) return ret def main(): N, K = [int(i) for i in stdin.readline().strip().split()] a = [char == '1' for char in stdin.readline().strip()] a_zvetsene = soucet_111(a, N) a.reverse() a_zvetsene.reverse() print((komb(N+1, K) - skip(a, True, N, K) - skip(a_zvetsene, False, N+1, N+1-K)) % 1000000007) main()