#include <bits/stdc++.h>
using namespace std;
int a[2002];
int n, b;
int dollar = 0;
void input() {
  cin >> n >> b;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
}
void process() {
  int low = -1;
  int max = b;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (a[j] > a[i]) {
        int b1 = b;
        int temp = b1 / a[i];
        b1 = b1 % a[i];
        b1 = a[j] * temp + b1;
        if (b1 > max) max = b1;
      }
    }
  }
  cout << max << endl;
}
int main() {
  input();
  process();
  return 0;
}
