#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b, m;
  cin >> n >> b;
  vector<int> a(n), maxx(n), minn(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++)
    minn[i] = (i == 0) ? a[i] : min(minn[i - 1], a[i]);
  for (int i = n - 1; i >= 0; i--)
    maxx[i] = (i == n - 1) ? a[i] : max(maxx[i + 1], a[i]);
  m = b;
  for (int i = 0; i < n - 1; i++)
    m = max(m, (b / minn[i]) * maxx[i + 1] + b % minn[i]);
  cout << m;
  return 0;
}
