#include <bits/stdc++.h>
using namespace std;
long long const MAXA = 1000000009;
void printa(int j, int n, int *a) {
  for (int i = j; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
int main() {
  int n, b, ans;
  cin >> n >> b, ans = b;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++)
    for (int j = i + 1; j < n; j++)
      ans = max(ans, (b % a[i] + b / a[i] * a[j]));
  cout << ans << endl;
}
