#include <bits/stdc++.h>
using namespace std;
const long long int N = 300009;
const long long int mod = 998244353;
long long int n, k;
long long int a[N], sum = 0;
void pre() {}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin.exceptions(cin.failbit);
  ;
  pre();
  cin >> n >> k;
  vector<long long int> pos;
  for (long long int i = 0; i < (n); ++i) {
    cin >> a[i];
    if (a[i] >= (n - k + 1)) {
      pos.push_back(i);
      sum += a[i];
    }
  }
  long long int ans = 1;
  for (long long int i = 1; i < ((long long int)((pos).size())); ++i) {
    ans *= (pos[i] - pos[i - 1]);
    ans %= mod;
  }
  cout << sum << " " << ans << "\n";
  return 0;
}
