#include <bits/stdc++.h>
using namespace std;
int dX[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dY[] = {1, -1, 0, 0, 1, -1, -1, 1};
int a[2500];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  int sum = m, ans = m;
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < n; ++i) {
    if (a[i] > m) continue;
    sum = m;
    int dol = sum / a[i];
    sum -= dol * a[i];
    for (int j = i + 1; j < n; ++j) {
      sum += dol * a[j];
      ans = max(ans, sum);
      sum -= dol * a[j];
    }
  }
  cout << ans;
  return 0;
}
