#include <bits/stdc++.h>
int main(void) {
  int n, a[2000], i, j, b, sum = -2, d;
  scanf("%d%d", &n, &b);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int T, h, r;
  for (i = 0; i < n; i++) {
    d = b / a[i];
    for (j = i + 1; j < n; j++) {
      r = b % a[i];
      T = (a[j] * d) + r;
      if (T > sum) {
        sum = T;
      }
    }
  }
  if (sum > b)
    printf("%d", sum);
  else
    printf("%d", b);
}
