#include <bits/stdc++.h>
using namespace std;
void func() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long min = n - k;
  long long i = 0;
  if (a[0] > min)
    i = 0;
  else {
    while (a[i] <= min) i++;
  }
  long long cnt = 0;
  vector<long long> vect;
  for (int j = i + 1; j < n; j++) {
    if (a[j] <= min)
      cnt++;
    else {
      vect.push_back(cnt + 1);
      cnt = 0;
    }
  }
  vect.push_back(cnt + 1);
  long long ans1 = 0, ans2 = 1;
  for (int j = n; j > min; j--) ans1 = ans1 + j;
  for (int j = 0; j < vect.size() - 1; j++) {
    ans2 = ans2 * vect[j];
    if (ans2 > 998244353) ans2 = ans2 % 998244353;
  }
  ans2 = ans2 % 998244353;
  cout << ans1 << " " << ans2 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) func();
}
