#include <bits/stdc++.h>
using namespace std;
int main() {
  int day, cash;
  int price[2050] = {0};
  scanf("%d %d", &day, &cash);
  for (int i = 0; i < day; i++) {
    scanf("%d", &price[i]);
  }
  int ans = cash;
  for (int i = 0; i < day; i++) {
    int k = cash / price[i];
    for (int j = i + 1; j < day; j++) {
      int count = cash - (k * price[i]);
      count += k * price[j];
      ans = max(ans, count);
    }
  }
  cout << ans;
  return 0;
}
