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