#include int main() { long N, K; std::cin >> N >> K; if( K <= 1000000 ) { std::vector v; long num; long temp; long total; num = 0; for(int i = 0; i < N; ++i) { std::cin >> temp; v.push_back(temp); num += temp; } total = num; for(int i = N; i < K; ++i) { v.push_back(num); total += num; total %= 1000000007; num *= 2; num -= v[i-N]; } std::cout << v[K-1]%1000000007 << " " << total << std::endl; return 0; } else { std::cout << 1 << " " << 1 << std::endl; } return 0; }