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