import sys input = sys.stdin.readline def mat_mul(A, B): C = [[0]*len(B[0]) for _ in range(len(A))] for i in range(len(A)): for j in range(len(B[0])): for k in range(len(A[0])): C[i][j] += A[i][k]*B[k][j] C[i][j] %= MOD return C def mat_pow(A, n): res = [[0]*len(A) for _ in range(len(A))] for i in range(len(A)): res[i][i] = 1 while n>0: if n&1: res = mat_mul(res, A) n >>= 1 A = mat_mul(A, A) return res N, K = map(int, input().split()) A = list(map(int, input().split())) MOD = 10**9+7 if K<=10**6: dp = [0]*K for i in range(N): dp[i] = A[i] s = sum(A) for i in range(N, K): dp[i] = s s += dp[i]-dp[i-N] s %= MOD print(dp[K-1], sum(dp)%MOD) else: M1 = [[0]*N for _ in range(N)] for i in range(N-1): M1[i][i+1] = 1 for i in range(N): M1[N-1][i] = 1 x = [[A[i]] for i in range(N)] F = mat_mul(mat_pow(M1, K-N), x)[N-1][0] M2 = [[0]*(N+1) for _ in range(N+1)] for i in range(N): M2[i][i+1] = 1 M2[N][0] = -1 M2[N][N] = 2 x = [[0]] acc = 0 for i in range(N): acc += A[i] x.append([acc]) S = mat_mul(mat_pow(M2, K-N), x)[N][0] print(F, S)