#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, n, a, b;
  cin >> n >> b;
  long long arr[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long max = INT_MIN, comp;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      if (arr[i] < arr[j]) {
        comp = ((b / arr[i]) * arr[j]) + (b % arr[i]);
        if (comp > max) max = comp;
      }
    }
  }
  if (max == INT_MIN)
    cout << b;
  else
    cout << max;
  return 0;
}
