#include <bits/stdc++.h>
using namespace std;
long long A[2222];
long long i, N, M, Ret, j;
int main() {
  cin >> N >> M;
  for (i = 0; i < N; i++) cin >> A[i];
  Ret = M;
  for (i = 0; i < N; i++)
    for (j = i + 1; j < N; j++) Ret = max(Ret, M / A[i] * A[j] + M % A[i]);
  cout << Ret << endl;
  return 0;
}
