#include <bits/stdc++.h>
using namespace std;
const double PI = atan(1.0) * 4;
const int64_t INF = 1000000000000000003;
const int32_t LOG = 21;
const long long int MOD = 998244353;
long long int a[200005];
long long int pos[200005];
long long int pow2[200005];
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int tests = 1;
  for (long long int ii = 0; ii < tests; ii++) {
    long long int n, k;
    cin >> n >> k;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      pos[a[i]] = i;
    }
    vector<long long int> v;
    long long int cur = n;
    long long int sum = 0;
    for (long long int i = 0; i < k; i++) {
      v.push_back(pos[cur]);
      sum += cur;
      cur--;
    }
    sort(v.begin(), v.end());
    cout << sum << " ";
    long long int ans = 1;
    long long int siz = v.size();
    for (long long int i = 0; i < siz - 1; i++) {
      long long int len = v[i + 1] - v[i];
      ans = (ans * len) % MOD;
    }
    cout << ans << '\n';
  }
  return 0;
}
