#include <bits/stdc++.h>
using namespace std;
const int MAXn = 2 * 1000 + 1000;
int main() {
  ios::sync_with_stdio(false);
  int n, m, maxi, a[MAXn];
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  maxi = m;
  for (int i = 1; i <= n; ++i)
    for (int j = i + 1; j <= n; ++j) {
      int v = m / a[i], u = m % a[i], tmp = v * a[j] + u;
      maxi = max(maxi, tmp);
    }
  cout << maxi << endl;
}
