#include <bits/stdc++.h>
using namespace std;
int i, j, b, n, a[2001], mx;
int main() {
  cin >> n >> b;
  for (i = 1; i <= n; i++) cin >> a[i];
  mx = b;
  for (i = 1; i <= n - 1; i++)
    for (j = i + 1; j <= n; j++)
      if (mx < (b / a[i]) * a[j] + b % a[i]) mx = (b / a[i]) * a[j] + b % a[i];
  cout << mx;
}
