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