#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
// Read the favorite burgers of all people
vector<int> fav(N);
for (int i = 0; i < N; ++i) {
cin >> fav[i];
}
int joshFav = fav[N-1]; // Josh's favorite burger (the last person's favorite)
// Count how many people before Josh have the same favorite burger as Josh
int countJoshFavBefore = 0;
for (int i = 0; i < N - 1; ++i) {
if (fav[i] == joshFav) {
countJoshFavBefore++;
}
}
// Initial probability that Josh's burger survives the coach's pick
double probability = 1.0;
probability *= (double)(M - 1) / M; // Chance that the coach doesn't pick Josh's burger
// There are M-1 burgers left after the coach picks
int remainingBurgers = M - 1;
// For every person who shares Josh's favorite burger, update the probability
for (int i = 0; i < N - 1; ++i) {
if (fav[i] == joshFav) {
probability *= (double)(remainingBurgers - 1) / remainingBurgers;
remainingBurgers--;
} else {
// If they don't care about Josh's burger, just reduce the number of burgers left
remainingBurgers--;
}
}
// Output the final probability with six decimal precision
cout << fixed << setprecision(6) << probability << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPHZlY3Rvcj4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKICAgIGludCBOLCBNOwogICAgY2luID4+IE4gPj4gTTsKCiAgICAvLyBSZWFkIHRoZSBmYXZvcml0ZSBidXJnZXJzIG9mIGFsbCBwZW9wbGUKICAgIHZlY3RvcjxpbnQ+IGZhdihOKTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgKytpKSB7CiAgICAgICAgY2luID4+IGZhdltpXTsKICAgIH0KCiAgICBpbnQgam9zaEZhdiA9IGZhdltOLTFdOyAgLy8gSm9zaCdzIGZhdm9yaXRlIGJ1cmdlciAodGhlIGxhc3QgcGVyc29uJ3MgZmF2b3JpdGUpCgogICAgLy8gQ291bnQgaG93IG1hbnkgcGVvcGxlIGJlZm9yZSBKb3NoIGhhdmUgdGhlIHNhbWU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