#include <bits/stdc++.h>
using namespace std;
long long a[1000000];
long long b[1000000];
long long pos = 0;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] <= n && a[i] > n - k) {
      b[pos++] = i;
    }
  }
  long long ans = 0;
  long long ways = 1;
  for (long long i = 0; i < k; i++) {
    ans += (n - i) % 998244353;
  }
  for (long long i = 1; i < k; i++) {
    ways = (ways * 1LL * (b[i] - b[i - 1])) % 998244353;
  }
  cout << ans << " " << ways;
}
