#include <bits/stdc++.h>
using namespace std;
long long int n, k, p[200005], sum, flag[200005];
int main() {
  cin >> n >> k;
  vector<long long int> vec;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    vec.push_back(p[i]);
  }
  sort(vec.rbegin(), vec.rend());
  for (int i = 0; i < k; i++) {
    sum += vec[i];
    flag[vec[i]] = true;
  }
  vector<long long int> dif;
  for (int i = 1; i <= n; i++) {
    if (flag[p[i]]) {
      dif.push_back(i);
    }
  }
  long long int mul = 1;
  for (int i = 1; i < dif.size(); i++) {
    mul = (mul % 998244353 * (dif[i] - dif[i - 1]) % 998244353) % 998244353;
  }
  cout << sum << ' ' << mul << endl;
  return 0;
}
