#include <bits/stdc++.h>
using namespace std;
int n, b;
int mm[2200], x[2200];
int main() {
  cin >> n >> b;
  for (int i = 0; i < n; i++) cin >> x[i];
  mm[n - 1] = x[n - 1];
  for (int i = n - 2; i >= 0; i--) mm[i] = max(x[i], mm[i + 1]);
  int mb = b;
  for (int i = 0; i < n - 1; i++)
    if (b / x[i] * mm[i + 1] + b % x[i] > mb)
      mb = b / x[i] * mm[i + 1] + b % x[i];
  cout << mb;
  return 0;
}
