#include <bits/stdc++.h>
using namespace std;
const long long int N = 200010;
const long long int MOD = 998244353;
long long int mod(long long int n) { return (n % MOD + MOD) % MOD; }
void solve() {
  long long int n, b, c;
  cin >> n >> b;
  c = b;
  vector<long long int> u, v;
  for (int i = 0; i < n; i++) {
    long long int temp;
    cin >> temp;
    v.push_back(temp);
  }
  for (int i = 0; i < n - 1; i++) {
    if (v[i] <= c) {
      u = v;
      sort(u.begin() + i + 1, u.end());
      if (u[u.size() - 1] > v[i]) {
        long long int p = c % v[i], q = u[u.size() - 1], r = c / v[i];
        b = max(b, p + q * r);
      }
    }
    u.clear();
  }
  cout << b << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  for (long long int i = 0; i < T; i++) solve();
}
