#include <bits/stdc++.h>
using namespace std;
const float pi = 3.141592653589793238;
long long toint(const string &s) {
  stringstream second;
  second << s;
  long long x;
  second >> x;
  return x;
}
string tostring(long long number) {
  stringstream second;
  second << number;
  return second.str();
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, b, no_of_dollars, sum, ans = INT_MIN;
  cin >> n >> b;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  if (is_sorted(arr, arr + n, greater<long long>())) {
    cout << b;
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      if (arr[j] > arr[i]) {
        no_of_dollars = b / arr[i];
        sum = b % arr[i] + no_of_dollars * arr[j];
        ans = max(ans, sum);
      }
    }
  }
  cout << ans;
  return 0;
}
