#include <bits/stdc++.h>
using namespace std;
bool isvowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'A' ||
      c == 'E' || c == 'I' || c == 'O' || c == 'U')
    return true;
  return false;
}
bool prime[5000001];
int spf[5000001];
vector<int> primes;
void sieve() {
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= 5000000; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= 5000000; i += p) {
        prime[i] = false;
        if (spf[i] == 0) spf[i] = p;
      }
    }
  }
  for (int p = 2; p <= 5000000; p++)
    if (prime[p]) primes.push_back(p);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long fast_exp(long long x, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans *= x;
    n = n >> 1;
    x = x * x;
  }
  return ans;
}
long long mod_exp(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long pre_sum[20005], dp[2005][2005];
vector<int> adj[200005];
void solve() {
  int n, k;
  cin >> n >> k;
  int a[n];
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]] = i;
  }
  long long sum = 0;
  int num = n;
  vector<long long> v;
  while (k--) {
    sum += num;
    v.push_back(m[num]);
    num--;
  }
  sort(v.begin(), v.end());
  long long ans = 1;
  for (long long i = 1; i < v.size(); i++) {
    long long d = v[i] - v[i - 1];
    ans = (ans * d) % 998244353;
  }
  cout << sum << " " << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    solve();
    cout << '\n';
  }
}
