#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
int a[N], n, b, ans, x, y;
int main() {
  cin >> n >> b;
  ans = b;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    x = b / a[i];
    y = b % a[i];
    for (int j = i + 1; j < n; j++)
      if (a[i] < a[j]) ans = max(ans, x * a[j] + y);
  }
  cout << ans;
}
