#include <bits/stdc++.h>
#define int long long int
using namespace std;
signed main(){
    ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int a , b;
	cin>>a>>b;
	cout<<(a+b)/2<<" "<<(a-b)/2<<"\n";
}

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>
#include<map>
#include<cassert>

using namespace std;

#define ll long long
#define reps(i, a, b) for(int i = a; i < b; i++)
#define rreps(i, a, b) for(int i = a-1; i >= b; i--)
#define rep(i, n) reps(i, 0, n)
#define rrep(i, n) rreps(i, n, 0)
#define P pair<int, int>
#define vec vector<ll>
#define mat vector<vec>

const ll mod = 1000000007;
const int INF = 1001001001;

int main(){
    ll n, x;
    cin >> n >> x;
    vec a(n);
    vec r(n-1);
    rep(i, n) cin >> a[i];
    rep(i, n-1) r[i] = a[i+1] / a[i];
    vec X(n);
    ll x_ = x;
    rrep(i, n){
        X[i] = x_ / a[i];
        x_ %= a[i];
    }
    // rep(i, n){
    //     cout << X[i] << " ";
    // }cout << endl;
    // rep(i, n){
    //     cout << r[i] << " ";
    // }cout << endl;
    mat dp(n, vec(2));
    dp[0][0] = 1;
    dp[0][1] = 0;
    rep(i, n-1){
        if(X[i] == r[i]-1){
            dp[i+1][0] = dp[i][0];
            dp[i+1][1] = dp[i][0] + dp[i][1];
        }else if(X[i] == 0){
            dp[i+1][0] = dp[i][0] + dp[i][1];
            dp[i+1][1] = dp[i][1];
        }else{
            dp[i+1][0] = dp[i][0] + dp[i][1];
            dp[i+1][1] = dp[i][0] + dp[i][1];
        }
        // cout << dp[i+1][0] << " " << dp[i+1][1] << endl;
    }
    cout << dp[n-1][0] + dp[n-1][1] << endl;
}