#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const long long mod = 998244353;
struct node {
  long long val, id;
} a[maxn];
bool cmp(node A, node B) { return A.val > B.val; }
bool cmp1(node A, node B) { return A.id < B.id; }
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i].val);
    a[i].id = i;
  }
  long long sum = 0, cnt = 1;
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= k; i++) sum += a[i].val;
  sort(a + 1, a + k + 1, cmp1);
  for (int i = 2; i <= k; i++) cnt = cnt * (a[i].id - a[i - 1].id) % mod;
  printf("%lld %lld\n", sum, cnt);
  return 0;
}
