#include <bits/stdc++.h>
using namespace std;
int n, b, a[5000];
int mmaxx[5000];
int main() {
  cin >> n >> b;
  bool OK = true;
  int maxx;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0)
      maxx = a[0];
    else {
      if (a[i] > maxx) {
        OK = false;
      } else
        maxx = a[i];
    }
  }
  if (OK == true) {
    cout << b;
    return 0;
  }
  mmaxx[n - 1] = a[n - 1];
  for (int i = n - 2; i > -1; i--) {
    if (a[i] > mmaxx[i + 1])
      mmaxx[i] = a[i];
    else
      mmaxx[i] = mmaxx[i + 1];
  }
  maxx = -1;
  for (int i = 0; i < n - 1; i++) {
    if ((b / a[i]) * mmaxx[i + 1] + (b % a[i]) > maxx)
      maxx = (b / a[i]) * mmaxx[i + 1] + (b % a[i]);
  }
  cout << maxx;
  return 0;
}
