#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int maxn = 1e2 + 5;
const double EPS = 1e-6;
using namespace std;
long long n, m, k;
long long kpow(long long a, long long b) {
  long long ans = 1;
  for (; b;) {
    if (b & 1) ans = ans * a % (long long)mod;
    b >>= 1;
    a = a * a % mod;
  }
  return (ans % mod);
}
long long solve() {
  if ((n & 1) != (m & 1) && k == -1) return 0;
  return kpow(kpow(2, n - 1), m - 1);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  printf("%lld\n", solve());
  return 0;
}
