#include <bits/stdc++.h>
using namespace std;
int s[2005];
int c[2005];
int main() {
  int n, b, i, j, ans, u;
  while (~scanf("%d %d", &n, &b)) {
    u = -1;
    for (i = 0; i < n; i++) {
      scanf("%d", &s[i]);
    }
    for (i = 0; i < n; i++) {
      int t = 0;
      for (j = 0; j <= i; j++) {
        if (s[i] >= s[j]) {
          c[t++] = s[j];
        }
      }
      sort(c, c + t);
      int k = 0, ans = 0;
      int w = b;
      while (1) {
        if (w >= c[k] && k < t) {
          ans += w / c[k];
          w = w % c[k];
          k++;
        } else {
          break;
        }
      }
      u = max(u, ans * s[i] + w);
    }
    printf("%d\n", u);
  }
  return 0;
}
