import std.array, std.stdio, std.string, std.algorithm, std.conv; import std.range; long[] fibmem; long N, K; void main() { auto nk = readln.split.map!(to!long); N = nk[0]; K = nk[1]; long[] A = readln.split.map!(to!long).array; fibmem.length = K+1; foreach(ref i; fibmem) i = -1; foreach(i, a; A) fibmem[i] = a; long f = fib(K-1) % (10 ^^9 + 7); long s = 0; foreach(i; 0..K) { s += fib(i) % (10 ^^ 9 + 7); s %= 10 ^^ 9 + 7; } writeln(f, ' ', s); } long fib(long n) { if (fibmem[n] != -1) return fibmem[n]; long ret = 0; foreach_reverse (i; 1..N+1) { ret += fib(n-i); } fibmem[n] = ret; return ret; }