import java.io.*; import java.util.*; public class Main_yukicoder194 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Printer pr = new Printer(System.out); int n = sc.nextInt(); long k = sc.nextLong(); if (k <= 1_000_000) { int[] f = new int[(int)k + 1]; int[] s = new int[(int)k + 1]; for (int i = 1; i <= k; i++) { if (i <= n) { f[i] = sc.nextInt(); } else { f[i] = (s[i - 1] - s[i - n - 1] + MOD) % MOD; } s[i] = (s[i - 1] + f[i]) % MOD; } pr.printf("%d %d\n", f[(int)k], s[(int)k]); } else { int[] a = new int[n + 1]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); a[n] += a[i]; } int[][] x = new int[n + 1][n + 1]; for (int i = 0; i < n - 1; i++) { x[i][i + 1] = 1; } Arrays.fill(x[n - 1], 1); x[n - 1][n] = 0; Arrays.fill(x[n], 1); long loop = k - n; while (loop > 0) { if (loop % 2 == 1) { a = Matrix.mul(x, a); } x = Matrix.mul(x, x); loop /= 2; } pr.printf("%d %d\n", a[n - 1], a[n]); } pr.close(); sc.close(); } private static final int MOD = 1_000_000_007; private static class Matrix { static int[] mul(int[][] x, int[] a) { int n = a.length; int[] b = new int[n]; for (int i = 0; i < n; i++) { long tmp = 0; for (int j = 0; j < n; j++) { tmp += (long)x[i][j] * a[j]; tmp %= MOD; } b[i] = (int)tmp; } return b; } static int[][] mul(int[][] x, int[][] x2) { int n = x[0].length; int[][] b = new int[n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { long tmp = 0; for (int k = 0; k < n; k++) { tmp += (long)x[i][k] * x2[k][j]; tmp %= MOD; } b[i][j] = (int)tmp; } } return b; } } @SuppressWarnings("unused") private static class Scanner { BufferedReader br; Iterator it; Scanner (InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } String next() throws RuntimeException { try { if (it == null || !it.hasNext()) { it = Arrays.asList(br.readLine().split(" ")).iterator(); } return it.next(); } catch (IOException e) { throw new IllegalStateException(); } } int nextInt() throws RuntimeException { return Integer.parseInt(next()); } long nextLong() throws RuntimeException { return Long.parseLong(next()); } float nextFloat() throws RuntimeException { return Float.parseFloat(next()); } double nextDouble() throws RuntimeException { return Double.parseDouble(next()); } void close() { try { br.close(); } catch (IOException e) { // throw new IllegalStateException(); } } } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }