#include <bits/stdc++.h>
using namespace std;
long long F(long long a, long long b) {
  long long res = 1, tp = a;
  while (b) {
    if (b & 1ll) {
      res *= tp;
      res %= 1000000007ll;
    }
    tp *= tp;
    tp %= 1000000007ll;
    b >>= 1ll;
  }
  return res;
}
int main() {
  long long n, m, k;
  scanf("%lld%lld%lld", &n, &m, &k);
  if ((n + m) & 1ll && k == -1ll)
    printf("0\n");
  else
    printf("%lld\n", F(F(2ll, n - 1), m - 1));
}
