#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char ch = getchar();
  int f = 0;
  x = 0;
  while (!isdigit(ch)) {
    if (ch == '-') f = 1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
  if (f) x = -x;
}
const int N = 2e5 + 5, mod = 998244353;
int n, k, a[N], sum = 1;
long long res;
vector<pair<int, int> > v;
vector<int> vc;
signed main() {
  read(n), read(k);
  for (int i = 1; i <= n; ++i) read(a[i]), v.push_back(make_pair(a[i], i));
  sort(v.begin(), v.end());
  for (int i = 1; i <= k; ++i)
    vc.push_back(v[n - i].second), res += v[n - i].first;
  sort(vc.begin(), vc.end());
  for (int i = 0; i < k - 1; ++i) sum = 1ll * sum * (vc[i + 1] - vc[i]) % mod;
  return printf("%lld %d\n", res, sum), 0;
}
