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