import java.awt.Point; import java.awt.Rectangle; import java.awt.geom.Rectangle2D; import java.io.BufferedInputStream; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.ConcurrentSkipListSet; public class Main { static final int C = 1000000007; static final int CY = 1000000000; //long[] F; public void calc() { StringBuilder sb = new StringBuilder(); BufferedInputStream bs = new BufferedInputStream(System.in); Scanner sc = new Scanner(bs); int n = sc.nextInt(); long k = sc.nextLong(); long[] a = new long[n]; long flen = Math.min(Integer.MAX_VALUE, k); //F = new long[(int)flen]; for (int i=0; i < n; i++) { a[i] = sc.nextInt(); //F[i] = a[i]; } long ansF = 0; long ansS = 0; //double ans = 0.0; long[] nums; nums = a.clone(); int index = 0; for (int i=0; i < k; i++) { long now; if (i >= n) { now = nums[index]; }else { now = a[index]; } nums[index] = 0; for (int t=0;t < n; t++) { nums[t] = mod(nums[t] + now); } index++; ansS = mod(ansS+now); if (i == k-1) { ansF = now % C; } if (index >= n) { index = 0; } } System.out.printf("%d %d",ansF, ansS); System.out.println(); } long mod(long num) { if (num >= C) { num -= C; } return num; } public static void main(String[] args) { Main main = new Main(); main.calc(); } }