#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int p = -1;
  long long res = 1, sum = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] >= (n - k + 1)) {
      sum += v[i];
      if (p != -1)
        res = (1ll * ((res % 998244353) * (i - p) % 998244353)) % 998244353;
      p = i;
    }
  }
  cout << sum << " " << res << endl;
}
