#include <bits/stdc++.h>
using namespace std;
int a[2005], b[10005];
int main() {
  int n, m, i, j, t, ans;
  scanf("%d%d", &n, &m);
  j = 0;
  t = 100000;
  ans = m;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    ans = max(ans, m % t + m / t * a[i]);
    t = min(a[i], t);
  }
  printf("%d\n", ans);
  return 0;
}
