#include <bits/stdc++.h>
using namespace std;
int main() {
  int inc = true, minn, maxx = 0, sum = 0, temp, i, j, k, A[10010], n, money;
  scanf("%d%d", &n, &money);
  for (i = 0; i < n; i++) scanf("%d", &A[i]);
  for (i = n - 1; i >= 0; i--) {
    maxx = (((maxx) > (A[i])) ? (maxx) : (A[i]));
    temp = money % A[i] + (money / A[i]) * maxx;
    sum = (((sum) > (temp)) ? (sum) : (temp));
  }
  printf("%d\n", sum);
  return 0;
}
