#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t = 1;
  while (t--) {
    long long int n, sum = 0, ans = 1, ct = 0, m, l, r, k;
    cin >> n >> k;
    long long int M = 998244353;
    long long int a[n];
    vector<long long int> v;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      v.push_back(a[i]);
    }
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    v.resize(k);
    reverse(v.begin(), v.end());
    for (long long int i = 0; i < v.size(); i++) sum += v[i];
    long long int pre = -1;
    for (long long int i = 0; i < n; i++) {
      if (binary_search(v.begin(), v.end(), a[i])) {
        if (pre != -1) ans = (ans % M * (i - pre) % M) % M;
        pre = i;
      }
    }
    cout << sum << " " << ans << '\n';
  }
  return 0;
}
