#include <bits/stdc++.h>
using namespace std;
int solve, N, arr[2005], a, K, b, temp;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K;
  for (int I = 0; I < N; ++I) {
    cin >> arr[I];
  }
  solve = INT_MIN;
  for (int I = 0; I < N; ++I) {
    for (int J = I; J < N; ++J) {
      a = K / arr[I];
      b = K % arr[I];
      temp = b + a * arr[J];
      solve = max(solve, temp);
    }
  }
  cout << solve << '\n';
}
