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