#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

template <class T>
struct BIT {
    BIT(int n) : b(n + 1), n(n) {}
    void add(int i, T v) {
        for (int k = i + 1; k <= n; k += k & -k) b[k] ^= v;
    }
    T sum(int k) {
        T s = 0;
        for (; k > 0; k -= k & -k) s ^= b[k];
        return s;
    }
    vector<T> b;
    int n;
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, q;
    cin >> n >> q;

    BIT<int> bt(n);

    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;

        bt.add(i, a);
    }

    while (q--) {
        int t, x, y;
        cin >> t >> x >> y;
        x--;

        if (t == 1) {
            bt.add(x, y);
        } else {
            cout << (bt.sum(y) ^ bt.sum(x)) << '\n';
        }
    }
    

    return 0;
}
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long, long long>
using namespace std;

const int mod = 1e9+7;
#define INF INT_MAX

int main()
{
	int n,m;
	cin>>n>>m;
	vector<pll> xs[n+1];
	for(int i =0;i<m;i++)
	{
		int x,y,z;
		cin>>x>>y>>z;
		xs[x].pb({y,z});	
	}
	vector<ll> dp(1<<n);
	vector<bool> ok(1<<n,1);
	for(int i = 1; i < 1<<n; i++)
	{
		int subsetsize = __builtin_popcount(i);
		for(auto [y,z] : xs[subsetsize])
		{
			int count = 0;
			for(int j = 1; j <= n;j++)
			{
				if(i&(1<<(j-1)) && j <= y)
					count++;
				
			}
			if(count > z)
			{
				ok[i] = 0;
				break;
			}
		}
	}
	dp[0] = 1;
	for (int i = 0; i < 1<<n; i++)
	{
		if(!ok[i])
			dp[i] = 0;
		for(int b = 0; b < n; b++)
		{
			if(!((1<<b)&i))
			{
				int nextid = i | (1<<b);
				dp[nextid] += dp[i];

			}
		}
	}
	cout<<dp[(1<<n)-1]<<"\n";

}