#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
int main() {
  cin >> n >> m;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  ans = m;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      ans = max(ans, int(m / a[i]) * a[j] + (m % a[i]));
    }
  }
  cout << ans << endl;
}
