#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int MAXN = 2e5 + 100;
const int INF = 0x3f3f3f3f;
inline long long fpow(long long a, long long b) {
  long long r = 1, t = a;
  while (b) {
    if (b & 1) r = (r * t) % MOD;
    b >>= 1;
    t = (t * t) % MOD;
  }
  return r;
}
int n, k;
pair<int, int> a[MAXN];
long long ans1, ans2 = 1;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].first);
    a[i].second = i;
  }
  sort(a + 1, a + n + 1, greater<pair<int, int> >());
  vector<long long> v;
  for (long long i = 1; i <= k; i++)
    ans1 += a[i].first, v.push_back(a[i].second);
  sort((v).begin(), (v).end());
  for (int i = 1; i < ((int)(v).size()); i++)
    ans2 = ((ans2 % MOD) * (v[i] - v[i - 1])) % MOD;
  cout << ans1 << " " << ans2 % MOD << endl;
  return 0;
}
