#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007ll;
long long mpow(long long n, long long p) {
  if (p == 0)
    return 1ll;
  else {
    long long aux = mpow(n, p / 2ll);
    aux *= aux;
    aux %= mod;
    if (p % 2ll == 0)
      return aux;
    else
      return (aux * n) % mod;
  }
}
long long inv(long long n) { return mpow(n, mod - 2ll); }
int main() {
  long long n, m, k;
  scanf("%lld %lld %lld", &n, &m, &k);
  if (n == 1ll || m == 1ll) {
    if (k == 1)
      printf("1\n");
    else {
      if ((n * m) % 2ll == 1)
        printf("1\n");
      else
        printf("0\n");
    }
  } else {
    if (n % 2ll != m % 2ll && k == -1ll) {
      printf("0\n");
      return 0;
    }
    long long tmp = mpow(2ll, n);
    tmp = mpow(tmp, m);
    long long aux = inv(mpow(2, m + n - 1ll));
    printf("%lld\n", (tmp * aux) % mod);
  }
}
