#include <bits/stdc++.h>
using namespace std;
int n, b, a[4000], d = 0, mx = -1;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> b;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int copb = b;
  for (int i = 1; i <= n; i++) {
    b = copb;
    if (a[i] <= b) {
      int mx1 = -1;
      d = b / a[i];
      b %= a[i];
      for (int j = i; j <= n; j++) mx1 = max(mx1, a[j]);
      b = b + d * mx1;
      d = 0;
    }
    mx = max(mx, b);
  }
  cout << mx;
  return 0;
}
