#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
vector<pair<long long, long long> > v;
vector<long long> vv;
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first >= b.first) return true;
  return false;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k, a;
  long long ans = 1, sum = 0;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a;
    v.push_back({a, i});
  }
  sort(v.begin(), v.end(), comp);
  for (long long i = 0; i < k; i++) {
    sum += v[i].first;
    vv.push_back(v[i].second);
  }
  sort(vv.begin(), vv.end());
  long long p = -1;
  bool flag = 0;
  for (auto &x : vv) {
    if (flag) ans = (ans * (x - p)) % MOD;
    flag = 1;
    p = x;
  }
  cout << sum << " ";
  cout << ans;
}
