#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 1;
int n, m;
int a[maxn], b[maxn], ans;
int main() {
  cin >> n >> m;
  ans = m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = m / a[i];
  }
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      ans = max(ans, b[j] * a[i] + (m - b[j] * a[j]));
    }
  }
  cout << ans;
}
