#include <bits/stdc++.h>
using namespace std;
double dp[2][200005], sum[2][200005];
int n, m, sump = 0;
int a[200005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    sump += a[i];
  }
  dp[0][0] = sum[0][0] = 1;
  for (int i = 1; i <= n * m; i++) sum[0][i] = 1;
  for (int i = 1; i <= n; i++) {
    int v = (i & 1) ^ 1;
    for (int r = 0; r <= n * m; r++) dp[i & 1][r] = sum[i & 1][r] = 0;
    for (int r = i; r <= i * m; r++) {
      int L = max(r - m, i - 1), R = min(r - 1, m * (i - 1));
      dp[i & 1][r] = (sum[v][R] - ((!L) ? 0 : sum[v][L - 1])) / (m - 1);
      if (L <= r - a[i] && r - a[i] <= R)
        dp[i & 1][r] -= dp[v][r - a[i]] / (m - 1);
    }
    for (int r = 1; r <= i * m; r++)
      sum[i & 1][r] = sum[i & 1][r - 1] + dp[i & 1][r];
  }
  double ans = 0;
  for (int i = n; i < sump; i++) ans += dp[n & 1][i];
  printf("%.9lf\n", ans * (m - 1) + 1);
}
