#include <bits/stdc++.h>
using namespace std;
long long n, m;
int k;
int modpow(long long base, long long ex) {
  if (ex == 0) return 1;
  if (ex == 1) return base;
  long long sq = ((base % 1000000007) * (base % 1000000007)) % 1000000007;
  if (ex % 2)
    return base * modpow(sq, (ex - 1) / 2) % 1000000007;
  else
    return modpow(sq, ex / 2) % 1000000007;
}
int solve() {
  if (k == -1 && (n % 2 != m % 2)) return 0;
  --n, --m;
  long long first = modpow(2, n) % 1000000007;
  return modpow(first, m) % 1000000007;
}
int main() {
  scanf("%I64d %I64d %d", &n, &m, &k);
  int ans = solve();
  cout << ans << '\n';
  return 0;
}
