#include <bits/stdc++.h>
using namespace std;
int main() {
  int days[10000];
  int day, money;
  cin >> day >> money;
  int simpan = 0;
  for (int a = 0; a < day; a++) {
    cin >> days[a];
  }
  simpan = max(simpan, money);
  for (int a = 0; a < day - 1; a++) {
    if (days[a] < money) {
      int multi = money / days[a];
      for (int b = a + 1; b < day; b++) {
        int now = money % days[a];
        if (days[b] > days[a]) {
          now = now + multi * days[b];
          simpan = max(simpan, now);
        }
      }
    }
  }
  cout << simpan << endl;
}
