#include <bits/stdc++.h>
using namespace std;
int n, q, c[200005];
struct seg {
  int sz, a[32], sum;
  void clr() {
    sz = sum = 0;
    memset(a, 0, sizeof(a));
  }
  void add(long long x) {
    for (int i = 31; i >= 0; i--)
      if (x & (1ll << i))
        if (a[i] == 0) {
          sz++;
          a[i] = x;
          break;
        } else
          x ^= a[i];
  }
  void merge(seg b) {
    for (int i = 31; i >= 0; i--)
      if (b.a[i]) add(b.a[i]);
  }
} t[800005];
void build(int x, int l, int r) {
  if (l == r) {
    t[x].clr();
    t[x].sum = c[l];
    t[x].add(c[l]);
    return;
  }
  int md = l + r >> 1;
  build(x << 1, l, md);
  build(x << 1 | 1, md + 1, r);
  if (t[x << 1].sz > t[x << 1 | 1].sz) {
    t[x] = t[x << 1];
    t[x].merge(t[x << 1 | 1]);
  } else {
    t[x] = t[x << 1 | 1];
    t[x].merge(t[x << 1]);
  }
  t[x].sum = t[x << 1].sum ^ t[x << 1 | 1].sum;
}
void chg(int x, int l, int r, int p) {
  if (l == r) {
    t[x].clr();
    t[x].sum = c[p];
    t[x].add(c[p]);
    return;
  }
  int md = l + r >> 1;
  if (p <= md)
    chg(x << 1, l, md, p);
  else
    chg(x << 1 | 1, md + 1, r, p);
  if (t[x << 1].sz > t[x << 1 | 1].sz) {
    t[x] = t[x << 1];
    t[x].merge(t[x << 1 | 1]);
  } else {
    t[x] = t[x << 1 | 1];
    t[x].merge(t[x << 1]);
  }
  t[x].sum = t[x << 1].sum ^ t[x << 1 | 1].sum;
}
seg qry(int x, int l, int r, int tl, int tr) {
  if (tl <= l && r <= tr) return t[x];
  int md = l + r >> 1;
  if (tr <= md) return qry(x << 1, l, md, tl, tr);
  if (tl > md) return qry(x << 1 | 1, md + 1, r, tl, tr);
  seg t1 = qry(x << 1, l, md, tl, tr), t2 = qry(x << 1 | 1, md + 1, r, tl, tr);
  if (t1.sz > t2.sz) {
    t1.merge(t2);
    return t1;
  } else {
    t2.merge(t1);
    return t2;
  }
}
int gts(int x, int l, int r, int tr) {
  if (r == tr) return t[x].sum;
  int md = l + r >> 1;
  if (tr <= md)
    return gts(x << 1, l, md, tr);
  else
    return t[x << 1].sum ^ gts(x << 1 | 1, md + 1, r, tr);
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  for (int i = n; i > 1; i--) c[i] ^= c[i - 1];
  build(1, 1, n);
  while (q--) {
    int kd, l, r;
    scanf("%d%d%d", &kd, &l, &r);
    if (kd == 1) {
      int v;
      scanf("%d", &v);
      c[l] ^= v;
      chg(1, 1, n, l);
      if (r + 1 <= n) {
        c[r + 1] ^= v;
        chg(1, 1, n, r + 1);
      }
    } else {
      seg sg;
      if (l < r)
        sg = qry(1, 1, n, l + 1, r);
      else
        sg.clr();
      int v = gts(1, 1, n, l);
      sg.add(v);
      printf("%d\n", 1 << sg.sz);
    }
  }
  return 0;
}
