#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, b;
  cin >> n >> b;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long int j = 0;
  long long int cmax = 0;
  long long int diff = 0;
  long long int cmin = INT_MAX;
  long long int a1 = -1, a2 = -1;
  long long int mcost = b;
  long long int cost;
  for (int i = 0; i < n; i++) {
    if (a[i] < cmin && a[i] <= b)
      cmin = a[i];
    else {
      cmax = a[i];
      a1 = cmin;
      a2 = cmax;
      cost = b % a1 + (b / a1) * a2;
      if (cost > mcost) mcost = cost;
    }
  }
  cout << mcost;
  return 0;
}
