#include <bits/stdc++.h>
using namespace std;
const long long INF = ~(1 << 31);
const double pi = acos(-1);
long long arr[30][30];
long long n, m, k;
long long cnt = 0;
void bc(long long r, long long c) {
  if (r == n) {
    bool valid = true;
    for (long long i = (0); i < (n); i++) {
      long long sum = 1;
      for (long long a = (0); a < (m); a++) sum *= arr[i][a];
      if (sum != k) valid = false;
    }
    for (long long i = (0); i < (m); i++) {
      long long sum = 1;
      for (long long a = (0); a < (n); a++) sum *= arr[a][i];
      if (sum != k) valid = false;
    }
    if (valid) cnt++;
    return;
  }
  if (c >= m) {
    bc(r + 1, 0);
    return;
  }
  arr[r][c] = 1;
  bc(r, c + 1);
  arr[r][c] = -1;
  bc(r, c + 1);
}
long long mod_pow(long long b, long long e, long long m) {
  long long res = 1;
  while (e) {
    if (e & 1) res = (res * b) % m;
    b = (b * b) % m, e >>= 1;
  }
  return res;
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> m >> k;
  long long h = n;
  long long first = min(h, m) - 1;
  long long second = max(max(h, m) - 1, 0LL);
  long long mod = 1e9 + 7;
  long long num = mod_pow(mod_pow(2, first, mod), second, mod);
  if (k == 1) {
    cout << num << endl;
  } else if (k == -1) {
    if (n % 2 == 0 && m % 2 == 0) {
      cout << num << endl;
    } else if (n % 2 == 0 || m % 2 == 0) {
      cout << 0 << endl;
    } else {
      cout << num << endl;
    }
  }
  return 0;
}
