import std.algorithm;
import std.array;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

immutable int mod = 1_000_000_007;

int solve (int n, int x, int [] s)
{
	sort (s);
	auto f = new int [] [] (2, x + 1);
	int b = 0;
	f[b][] = 0;
	f[b][x] = 1;
	foreach_reverse (k; 0..n)
	{
		b ^= 1;
		f[b][] = 0;
		foreach (a; 0..x + 1)
		{
			f[b][a % s[k]] = (f[b][a % s[k]] + f[!b][a]) % mod;
			f[b][a] = (f[b][a] + f[!b][a] * 1L * k) % mod;
		}
	}

	int res = 0;
	foreach (a; 0..x + 1)
	{
		res = (res + f[b][a] * 1L * a) % mod;
	}
	return res;
}

void main ()
{
	int n, x;
	while (readf (" %s %s", &n, &x) > 0)
	{
		readln;
		auto s = readln.splitter.map !(to !(int)).array;
		writeln (solve (n, x, s));
	}
}
