#include <bits/stdc++.h>
using namespace std;
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcount(s);
}
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
int n, m, k;
long long a[1000005], mu2[1000005];
map<long long, vector<pair<int, int> > > M;
map<long long, vector<pair<int, int> > >::iterator it;
bool flag[1000005];
vector<int> use;
vector<int> V[1000005];
int que[1000005], size;
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  for (int i = (1); i <= (n); ++i) cin >> a[i];
  for (int run = 0; run < (m); ++run) {
    int u, v;
    cin >> u >> v;
    long long x = a[u] ^ a[v];
    M[x].push_back(make_pair(u, v));
    M[x].push_back(make_pair(v, u));
  }
  mu2[0] = 1;
  for (int i = (1); i <= (1000005 - 1); ++i)
    mu2[i] = mu2[i - 1] * 2 % 1000000007;
  memset(flag, 0, sizeof(flag));
  long long res = 0, dem = 0;
  for (it = M.begin(); it != M.end(); it++) {
    dem++;
    vector<pair<int, int> > Vp = (*it).second;
    use.clear();
    for (int i = 0; i < (((int)(Vp).size())); ++i) {
      int u = Vp[i].first, v = Vp[i].second;
      if (!flag[u]) {
        flag[u] = 1;
        use.push_back(u);
      }
      if (!flag[v]) {
        flag[v] = 1;
        use.push_back(v);
      }
      V[u].push_back(v);
      V[v].push_back(u);
    }
    for (int i = 0; i < (((int)(use).size())); ++i) flag[use[i]] = 0;
    long long ret = 1;
    for (int i = 0; i < (((int)(use).size())); ++i) {
      int u = use[i];
      if (flag[u]) continue;
      size = 0;
      que[size++] = u;
      flag[u] = 1;
      for (int j = 0; j < (size); ++j) {
        int v = que[j];
        for (int j = 0; j < (((int)(V[v]).size())); ++j) {
          int t = V[v][j];
          if (!flag[t]) {
            flag[t] = 1;
            que[size++] = t;
          }
        }
      }
      ret = ret * 2 % 1000000007;
    }
    ret = ret * mu2[n - ((int)(use).size())] % 1000000007;
    res = (res + ret) % 1000000007;
    for (int i = 0; i < (((int)(use).size())); ++i) {
      flag[use[i]] = 0;
      V[use[i]].clear();
    }
  }
  res = (res + (mu2[k] - dem) * mu2[n] % 1000000007) % 1000000007;
  cout << res << endl;
  return 0;
}
