#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int a[maxn];
int main()
{
	int n, m, pos;
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; ++i) { scanf("%d", &pos); a[pos] ^= 1;}
	for(int i = 1; i <= m; ++i) { scanf("%d", &pos); a[pos] ^= 1;}
	for(int i = 1; i < maxn; ++i) if(a[i]) printf("%d ", i);
	return 0;
}
//Code By CXY07
#include<bits/stdc++.h>
using namespace std;

//#define FILE
#define int long long
#define debug(x) cout << #x << " = " << x << endl
#define file(FILENAME) freopen(FILENAME".in", "r", stdin), freopen(FILENAME".out", "w", stdout)
#define LINE() cout << "LINE = " << __LINE__ << endl
#define LL long long
#define ull unsigned long long
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fst first
#define scd second
#define inv(x) qpow((x),mod - 2)
#define lowbit(x) ((x) & (-(x)))
#define vec vector

const int MAXN = 60;
const int INF = 2e9;
const double PI = acos(-1);
const double eps = 1e-6;
//const int mod = 1e9 + 7;
//const int mod = 998244353;
//const int G = 3;
//const int base = 131;

int n, m, x;
int a[MAXN], cnt[MAXN], prod[MAXN];
int dp[MAXN][2][2];

template<typename T> inline bool read(T &a) {
	a = 0; char c = getchar(); int f = 1;
	while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
	while(c >= '0' && c <= '9') {a = a * 10 + (c ^ 48); c = getchar();}
	a *= f;
	return 1;
}

template<typename A, typename ...B>
inline bool read(A &x, B &...y) {return read(x) && read(y...);}

signed main () {
#ifdef FILE
	freopen(".in","r",stdin);
	freopen(".out","w",stdout);
#endif
	read(n); read(x);
	int tmpx = x;
	for(int i = 1; i <= n; ++i) {
		read(a[i]);
		if(i != 1) prod[i - 1] = a[i] / a[i - 1];
	}
	prod[n] = INF;
	for(int i = n; i >= 1; --i) {
		cnt[i] = tmpx / a[i];
		tmpx %= a[i];
	}
	dp[0][0][0] = 1;
	for(int i = 1; i <= n; ++i) {//dp[i][j][k] 第i位放/不放 进位/不进位
		if(prod[i] == cnt[i] + 1) {
			dp[i][0][1] += dp[i - 1][0][1] + dp[i - 1][1][1];
			dp[i][1][1] += dp[i - 1][1][0] + dp[i - 1][0][0];
			dp[i][0][0] += dp[i - 1][0][0] + dp[i - 1][1][0];
		} else {
			dp[i][0][0] += dp[i - 1][1][0] + dp[i - 1][0][0];
			dp[i][0][0] += dp[i - 1][1][1] + dp[i - 1][0][1];
			if(cnt[i]) dp[i][1][1] += dp[i - 1][0][0] + dp[i - 1][1][0];
			dp[i][1][1] += dp[i - 1][0][1] + dp[i - 1][1][1];
		}
	}
	cout << dp[n][0][0] << endl;
	return 0;
}

