#include<bits/stdc++.h>

using namespace std;

#define int               long long
#define MOD               1000000007
#define MAX               1000000000
#define ff                first
#define ss                second
#define mp                make_pair
#define pb                push_back
#define pii               pair<int,int>
#define sp(x,y)           fixed<<setprecision(y)<<x
#define setbits(x)        __builtin_popcount(x)
#define fast_in_out       ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);


//   powermod(a,b,m) ==  powermod(a,b%(m-1),m)  when m is prime fermat's theorem a^(p-1) %p=1 p is prime
int powermod(int a,int b,int c) //  gives (a^b)%c
{
    int ans = 1,tempans=a%c;
    while(b>0)
    {
        if(b&1==1)
        {
            ans=(ans*tempans)%c;
        }
             tempans=(tempans*tempans)%c;
             b=b>>1;
    }
    return ans;
}

int modinverse(int a,int m)   // gives a inverse wrt m and m is prime
{
    return powermod(a,m-2,m);
}
// my template                                              m
// prime factorization                                      pf
// ncr and factorials                                       ncr
// matrix exponentiation of fibonacci series in log(n)      matexpofib


void buildsegmenttree(int a[],int tree[],int start,int end,int treenode)
{
  if(start==end)
  {
    tree[treenode]=a[start];
    return;
  }
  int mid=(start+end)/2;
  buildsegmenttree(a,tree,start,mid,2*treenode);
  buildsegmenttree(a,tree,mid+1,end,2*treenode+1);

  tree[treenode]=tree[2*treenode]^tree[2*treenode+1];
}

void updatesegmenttree(int a[],int tree[],int start,int end,int treenode,int index,int value)
{
  if(start==end)
  {
    a[index]=value;
    tree[treenode]=value;
    return;


  }
   int mid=(start+end)/2;
   if(index>mid)
   {
    updatesegmenttree(a,tree,mid+1,end,2*treenode+1,index,value);
   }
   else
   {
    updatesegmenttree(a,tree,start,mid,2*treenode,index,value);
   }
   tree[treenode]=tree[2*treenode]^tree[2*treenode+1];

}
int query(int tree[],int start,int end,int treenode,int left,int right){
  //completely outside the given range

  if(start>right||end<left) {
    return 0;
  }


  //completely inside the given range

  if(start>=left&&end<=right){
    return tree[treenode];
  }


  //partially inside and partially outside

  int mid=(start+end)/2;
  int ans1=query(tree,start,mid,2*treenode,left,right);
  int ans2=query(tree,mid+1,end,2*treenode+1,left,right);
  return ans1^ans2;
}

int32_t main()
{
  fast_in_out;

  int n,q;cin>>n>>q;
   int a[n];
   for(int i=0;i<n;i++) cin>>a[i];

    int tree[4*n]={0};
  buildsegmenttree(a,tree,0,n-1,1);
  while(q--)
  {
      int t,x,y;
      cin>>t>>x>>y;
      if(t==1)
      {
          updatesegmenttree(a,tree,0,n-1,1,x-1,a[x-1]^y);
      }
      else
      {
          int ans = query(tree,0,n-1,1,x-1,y-1);
          cout<<ans<<endl;
      }
  }

    return 0;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937/*_64*/ rng(chrono::steady_clock::now().time_since_epoch().count());
#define printArr(arr, n) cerr << #arr << " = ["; for(int i=0; i<(n); i++){if (i) cerr << ", "; cerr << arr[i];} cerr << "]\n"
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
	cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
void _print() {cerr << "]\n";}
template <typename T, typename... V> void _print(T t, V... v) {cerr << t; if (sizeof...(v)) cerr << ", "; _print(v...);}
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n,x;
	cin >> n >> x;
	ll a[n];
	for (int q = 0; q < n; q++) cin >> a[q];
	vector<map<ll,ll>> dp(n);
	dp[n-1][x%a[n-1]] = 1;
	dp[n-1][(x%a[n-1])-a[n-1]] = 1;
	for (int q = n-2; q >= 0; q--)
	{
		auto it = dp[q+1].begin();
		while (it != dp[q+1].end())
		{
			if (abs((it->first -(x%a[q]))/a[q]) < a[q+1]/a[q]) dp[q][x%a[q]]+=it->second;
			if (abs((it->first-(x%a[q])+a[q])/a[q]) < a[q+1]/a[q]) dp[q][(x%a[q])-a[q]]+=it->second;
			it++;
		}
	}
	cout << dp[0][0] << "\n";
	return 0;
}

