#include <bits/stdc++.h>
using namespace std;
const long long inf = INT_MAX;
const long double ep = 0.0000001;
const long double pi = acos(-1.0);
const long long md = 1e9 + 7;
void solve() {
  int n, b;
  cin >> n >> b;
  int arr[n];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  int mx = b;
  for (int i = 0; i < n - 1; ++i) {
    int s = 0;
    if (b >= arr[i]) {
      int l = b / arr[i];
      int x = (*max_element(arr + i + 1, arr + n));
      int cp = arr[i] * l;
      int sp = x * l;
      s = b - cp + sp;
    }
    mx = max(mx, s);
  }
  cout << mx;
}
signed main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) solve();
}
