#include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a;
  long long ans = 1;
  long long idx = -1;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a >= (n - k + 1)) {
      if (idx != -1) ans = 1ll * ans * (i - idx) % M;
      idx = i;
    }
  }
  long long mxv = (n * (n + 1)) / 2 - ((n - k) * (n - k + 1)) / 2;
  cout << mxv << " " << ans << endl;
  return 0;
}
