#include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
int n, k, ans = 1, a[200005], p[200005];
long long cnt;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    p[a[i]] = i;
  }
  sort(p + n - k + 1, p + n + 1);
  for (int i = n - k + 1; i <= n; i++) {
    cnt += i;
    if (i < n) ans = 1LL * ans * (p[i + 1] - p[i]) % M;
  }
  printf("%lld %d\n", cnt, ans);
  return 0;
}
