#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    long long int n, b, b1, c = 0;
    cin >> n >> b;
    long long int a[n];
    b1 = b;
    for (long long int i = 0; i < n; i++) cin >> a[i];
    for (long long int i = 0; i < n; i++) {
      for (long long int j = i + 1; j < n; j++) {
        if (a[i] <= b and a[j] > a[i]) {
          b1 = max(b1, b - (b / a[i]) * a[i] + (b / a[i]) * a[j]);
        }
      }
    }
    cout << b1;
  }
  return 0;
}
