#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e3 + 9;
long long int mod = 1e9 + 7;
long long int quick_mod(long long int a, long long int b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return ans;
}
int main() {
  long long int N, M, T;
  while (~scanf("%lld%lld%lld", &N, &M, &T)) {
    if ((N + M) & 1 && T == -1) {
      cout << 0 << endl;
      continue;
    }
    long long ans = quick_mod(2, N - 1);
    ans = quick_mod(ans, M - 1);
    cout << ans << endl;
  }
  return 0;
}
