#include <bits/stdc++.h>
using namespace std;
long long a[200010];
signed main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  vector<pair<long long, long long>> res;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    res.push_back({a[i], i});
  }
  sort(res.rbegin(), res.rend());
  long long ans = 0;
  vector<long long> v;
  for (long long i = 0; i < k; i++) {
    ans += res[i].first;
    v.push_back(res[i].second);
  }
  cout << ans << ' ';
  ans = 1;
  sort(v.begin(), v.end());
  for (long long i = 1; i < v.size(); i++) {
    ans *= v[i] - v[i - 1];
    ans %= 998244353;
  }
  cout << ans;
}
