#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[200005], b[200005], tree2[800005], mi[31];
struct Tree {
  int p[30], num;
  void insert(int v) {
    for (int i = 29; i >= 0; i--)
      if ((v >> i) & 1) {
        if (!p[i]) {
          p[i] = v;
          num++;
          return;
        } else
          v ^= p[i];
      }
  }
} tree[800005], emp, ans;
void Build(int k, int l, int r) {
  for (int i = l; i <= r; i++) tree[k].insert(b[i]);
  if (l == r) return;
  int mid = (l + r) >> 1;
  Build(k << 1, l, mid);
  Build(k << 1 | 1, mid + 1, r);
}
Tree merge(Tree a, Tree b) {
  for (int i = 29; i >= 0; i--)
    if (b.p[i]) a.insert(b.p[i]);
  return a;
}
void update(int k, int l, int r, int ql, int qr, int v) {
  if (ql <= l && r <= qr) {
    tree2[k] ^= v;
    return;
  }
  int mid = (l + r) >> 1;
  if (ql <= mid) update(k << 1, l, mid, ql, qr, v);
  if (mid < qr) update(k << 1 | 1, mid + 1, r, ql, qr, v);
}
void update(int k, int l, int r, int x, int v) {
  if (l == r) {
    tree[k] = emp;
    tree[k].insert(v);
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(k << 1, l, mid, x, v);
  else
    update(k << 1 | 1, mid + 1, r, x, v);
  tree[k] = merge(tree[k << 1], tree[k << 1 | 1]);
}
int ask(int k, int l, int r, int x) {
  if (l == r) return tree2[k] ^ a[l];
  int mid = (l + r) >> 1;
  if (x <= mid)
    return ask(k << 1, l, mid, x) ^ tree2[k];
  else
    return ask(k << 1 | 1, mid + 1, r, x) ^ tree2[k];
}
void ask(int k, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) {
    ans = merge(ans, tree[k]);
    return;
  }
  int mid = (l + r) >> 1;
  if (ql <= mid) ask(k << 1, l, mid, ql, qr);
  if (mid < qr) ask(k << 1 | 1, mid + 1, r, ql, qr);
}
int main() {
  scanf("%d%d", &n, &m);
  mi[0] = 1;
  for (int i = 1; i <= 30; i++) mi[i] = mi[i - 1] * 2;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i] ^ a[i - 1];
  }
  Build(1, 1, n);
  while (m--) {
    int op, l, r;
    scanf("%d%d%d", &op, &l, &r);
    if (op == 1) {
      int v;
      scanf("%d", &v);
      update(1, 1, n, l, r, v);
      if (r != n) update(1, 1, n, r + 1, b[r + 1] ^= v);
      update(1, 1, n, l, b[l] ^= v);
    } else {
      ans = emp;
      ans.insert(ask(1, 1, n, l));
      if (l < r) ask(1, 1, n, l + 1, r);
      printf("%d\n", mi[ans.num]);
    }
  }
}
