#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long qsm(long long a, long long n) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = (ret % mod * a % mod) % mod;
    a = (a % mod * a % mod) % mod;
    n /= 2;
  }
  return ret;
}
int main() {
  long long n, m, k;
  scanf("%lld%lld%lld", &n, &m, &k);
  if (k == 1)
    printf("%lld\n", qsm(qsm(2, n - 1), m - 1) % mod);
  else {
    if ((n + m) & 1)
      puts("0");
    else
      printf("%lld\n", qsm(qsm(2, n - 1), m - 1));
  }
  return 0;
}
