#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long n, m;
int k;
long long fpow(long long a, long long b) {
  long long r = 1, base = a % MOD;
  while (b) {
    if (b & 1) r *= base, r %= MOD;
    base *= base;
    base %= MOD;
    b >>= 1;
  }
  return r;
}
int main() {
  cin >> n >> m >> k;
  if (k == -1 && (n + m) % 2 == 1) {
    printf("0\n");
    return 0;
  }
  long long ans = fpow(2, n - 1);
  ans = fpow(ans, m - 1);
  cout << ans << endl;
}
