#include <iostream>
using namespace std;
int n, b;
int a[2005];
long long shop(int buy, int sell)
{
long long ans = b / a[buy];
b = b - ans * a[buy];
ans *= a[sell];
ans += b;
return ans;
}
int main()
{
cin >> n >> b;
int m = b;
for(int i = 1; i <= n; i++) cin >> a[i];
long long maxn = 0;
for(int i = 1; i <= n-1; i++)
{
for(int j = i; j <= n; j++)
{
long long s = shop(i, j);
if(s > maxn) maxn = s;
}
b = m;
}
if(maxn > m) cout << maxn;
else cout << m;
return 0;
}