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