#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000 + 10;
int c[maxn];
int n, b;
int main() {
  cin >> n >> b;
  for (int i = 1; i <= n; i++) cin >> c[i];
  int sum = b;
  for (int buy = 1; buy <= n; buy++) {
    if (b >= c[buy]) {
      int x = b / c[buy], y = b % c[buy];
      for (int sell = buy + 1; sell <= n; sell++)
        if (c[sell] > c[buy]) sum = max(sum, x * c[sell] + y);
    }
  }
  cout << sum << endl;
}
