import java.util.Scanner; /** 2023/3/2 14:07 */ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { Integer num = sc.nextInt(); Integer init = sc.nextInt(); Integer[] mons = new Integer[num]; for (int i=0;i<num;i++){ mons[i] = sc.nextInt(); } calcute(num, init, mons); } } private static void calcute(int num, int init, Integer[] mons) { for (int i = 0; i < num; i++) { int mon = mons[i]; if (init >= mon) { init += mon; } else { init += odlj(init, mon); } } System.out.println(init); } public static int odlj(int n1, int n2) { int m = Math.max(n1, n2); int n = Math.min(n1, n2); while (m % n != 0) { int temp = m % n; m = n; n = temp; } return n; } }