#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  long long res = 0;
  long long a[n + 10], b[n + 10], pos[n + 10];
  for (int i = 1; i <= n; i++) cin >> a[i], b[i] = a[i], pos[a[i]] = i;
  sort(b + 1, b + n + 1, greater<int>());
  for (int i = 1; i <= k; i++) res += b[i];
  long long cnt = 1;
  vector<long long> v;
  for (int i = 1; i <= k; i++) v.push_back(1ll * pos[b[i]]);
  sort(v.begin(), v.end());
  for (int i = 1; i < v.size(); i++) cnt = cnt * (v[i] - v[i - 1]) % 998244353;
  cout << res << " " << cnt << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
