#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double pi = 3.141592653589793238462;
const int nmax = 200000;
const int hash_base = 119;
const long long inf = 2e18;
int n, b, a[3000], ans = 0;
int main() {
  scanf("%d%d", &n, &b);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int j = 1; j <= n; j++)
    for (int k = j; k <= n; k++) ans = max(ans, b % a[j] + (b / a[j]) * a[k]);
  cout << ans << endl;
  return 0;
}
