#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const long double pi = 3.14159265359;
const long long INF = 1e8;
long long n, a[N], mx;
long long b;
int main() {
  ios_base::sync_with_stdio();
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  ;
  cin >> n >> b;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      mx = max(mx, (b / a[i]) * a[j] + (b % a[i]));
    }
  }
  cout << max(mx, b);
}
