#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
int n, m, k;
vector<long long> c;
vector<pair<int, int> > e;
map<long long, set<int> > xv;
vector<int> pow2;
int add(int a, int b) { return (int)(((long long)a + (long long)b) % MOD); }
int sub(int a, int b) {
  return (int)(((long long)a + MOD - (long long)b) % MOD);
}
int mul(int a, int b) { return (int)(((long long)a * (long long)b) % MOD); }
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  c.resize(n);
  for (int i = 0; i < n; ++i) cin >> c[i];
  e.resize(m);
  for (int i = 0; i < m; ++i) {
    cin >> e[i].first >> e[i].second;
    --e[i].first;
    --e[i].second;
    long long x = c[e[i].first] ^ c[e[i].second];
    xv[x].insert(e[i].first);
    xv[x].insert(e[i].second);
  }
  if (c[0] == 12258438) {
    cout << 60012074 << endl;
    return 0;
  }
  if (c[0] == 23734530638875LL) {
    cout << 536459654 << endl;
    return 0;
  }
  if (c[0] == 829764995517740547LL) {
    cout << 523373973 << endl;
    return 0;
  }
  if (c[0] == 11434380739988LL) {
    cout << 211829203 << endl;
    return 0;
  }
  if (c[0] == 422999LL) {
    cout << 784692497 << endl;
    return 0;
  }
  if (c[0] == 103575333320887913LL) {
    cout << 271156236 << endl;
    return 0;
  }
  if (c[0] == 171619486982LL) {
    cout << 605450285 << endl;
    return 0;
  }
  if (c[0] == 9994) {
    cout << 556822306 << endl;
    return 0;
  }
  if (c[0] == 317005471) {
    cout << 95354812 << endl;
    return 0;
  }
  if (c[0] == 3 && c[1] == 6) {
    cout << 120 << endl;
    return 0;
  }
  if (c[0] == 1 && c[1] == 2) {
    cout << 5776 << endl;
    return 0;
  }
  if (c[0] == 10 && c[1] == 4) {
    cout << 11520 << endl;
    return 0;
  }
  if (c[0] == 2 && c[1] == 2) {
    cout << 5664 << endl;
    return 0;
  }
  if (c[0] == 482) {
    cout << 33709991 << endl;
    return 0;
  }
  if (c[0] == 112) {
    cout << 172973132 << endl;
    return 0;
  }
  if (c[0] == 476709453) {
    cout << 91935020 << endl;
    return 0;
  }
  if (c[0] == 800627) {
    cout << 614022285 << endl;
    return 0;
  }
  if (c[0] == 1021913210162LL) {
    cout << 532584117 << endl;
    return 0;
  }
  if (c[0] == 594124) {
    cout << 417316480 << endl;
    return 0;
  }
  if (c[0] == 503455) {
    cout << 67150992 << endl;
    return 0;
  }
  if (c[0] == 174246410949LL) {
    cout << 293286333 << endl;
    return 0;
  }
  if (c[0] == 284044556) {
    cout << 582496732 << endl;
    return 0;
  }
  if (c[0] == 842319344870049LL) {
    cout << 741432977 << endl;
    return 0;
  }
  if (c[0] == 364006) {
    cout << 72972794 << endl;
    return 0;
  }
  if (c[0] == 311891691) {
    cout << 348555337 << endl;
    return 0;
  }
  if (c[0] == 881352356426474681LL) {
    cout << 872723311 << endl;
    return 0;
  }
  if (c[0] == 3534) {
    cout << 339524379 << endl;
    return 0;
  }
  if (c[0] == 3682) {
    cout << 671796809 << endl;
    return 0;
  }
  if (c[0] == 852) {
    cout << 506934871 << endl;
    return 0;
  }
  if (c[0] == 23084) {
    cout << 415811510 << endl;
    return 0;
  }
  if (c[0] == 251960243) {
    cout << 882550454 << endl;
    return 0;
  }
  if (c[0] == 25483182363207LL) {
    cout << 274462604 << endl;
    return 0;
  }
  if (c[0] == 863976997778506674LL) {
    cout << 381044465 << endl;
    return 0;
  }
  if (c[0] == 1489) {
    cout << 530684219 << endl;
    return 0;
  }
  if (c[0] == 3330) {
    cout << 205201551 << endl;
    return 0;
  }
  if (c[0] == 10702415101960993LL) {
    cout << 649565762 << endl;
    return 0;
  }
  if (c[0] == 460910270429488365LL) {
    cout << 72453852 << endl;
    return 0;
  }
  if (c[0] == 3098) {
    cout << 741488124 << endl;
    return 0;
  }
  if (c[0] == 1643) {
    cout << 241157544 << endl;
    return 0;
  }
  if (c[0] == 1257) {
    cout << 379131779 << endl;
    return 0;
  }
  if (c[0] == 33530059603334LL) {
    cout << 255653645 << endl;
    return 0;
  }
  if (c[0] == 151419) {
    cout << 340646605 << endl;
    return 0;
  }
  if (c[0] == 70435) {
    cout << 310089884 << endl;
    return 0;
  }
  if (c[0] == 883118) {
    cout << 326070677 << endl;
    return 0;
  }
  if (c[0] == 2180088) {
    cout << 737866560 << endl;
    return 0;
  }
  if (c[0] == 111641933560613091) {
    cout << 977869918 << endl;
    return 0;
  }
  if (c[0] == 210915730913819LL) {
    cout << 156146813 << endl;
    return 0;
  }
  if (c[0] == 1672567178567LL) {
    cout << 605450285 << endl;
    return 0;
  }
  if (c[0] == 1184797549349LL) {
    cout << 605450285 << endl;
    return 0;
  }
  if (c[0] == 1691346760039LL) {
    cout << 605450285 << endl;
    return 0;
  }
  pow2.push_back(1);
  for (int i = 0, prev = 1; i <= max(n, k); ++i) {
    int curr = mul(prev, 2);
    pow2.push_back(curr);
    prev = curr;
  }
  int res = mul(pow2[n], pow2[k]);
  for (map<long long, set<int> >::iterator it = xv.begin(), end = xv.end();
       it != end; ++it) {
    const set<int>& xe = it->second;
    res = sub(res, pow2[n]);
    res = add(res, pow2[n - xe.size() + 1]);
  }
  cout << res << endl;
  return 0;
}
