#include <bits/stdc++.h>
using namespace std;

typedef long long lli;
typedef vector<int> Vi;
typedef vector<lli> Vl;
typedef pair<int, int> Pii;
typedef pair<lli, lli> Pll;


//===

const int MOD = (int)1e9 + 7;


int main()
{
	int N, X;
	cin >> N >> X;
	vector<int> S(N);
	for (int i = 0; i < N; ++i) cin >> S[i];

	sort(S.begin(), S.end());

	vector<Vl> dp(N + 1, Vl(X + 1));
	for (int x = 0; x <= X; ++x) dp[0][x] = x;

	for (int i = 0; i < N; ++i) {
		for (int x = 0; x <= X; ++x) {
			dp[i + 1][x] = (dp[i][x % S[i]] + i * dp[i][x]) % MOD;
		}
	}

	cout << dp[N][X] << endl;
}
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n, k; cin >> n >> k;
	vector<double> v(n);
	vector<double> expected(n);
	for(int i = 0; i < n; ++i) 
	{
		cin >> v[i];
		expected[i] = ((v[i]*(v[i]+1.0))/2.0)/v[i];
		
		if(i)
			expected[i] += expected[i-1];
		
	}
	double maxi = expected[k-1];
	double tolerance = 0.0000001;
	for(int i = k-1; i < n; ++i)
	{
		int pre = i - k;
		if(pre >= 0)
		{
			double cur = expected[i] - expected[pre];
			if(cur-maxi > tolerance)
				maxi = cur;
		}
	}

	cout << setprecision(17) <<  maxi;

	return 0;
	
}