#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long BIGMOD(long long b, long long p) {
  long long res = 1 % MOD, x = b % MOD;
  while (p) {
    if (p & 1) res = (res * x) % MOD;
    x = (x * x) % MOD;
    p >>= 1;
  }
  return res % MOD;
}
long long solve(long long n, long long m, long long k) {
  if ((k == -1) && ((n & 1) != (m & 1))) return 0;
  return BIGMOD(BIGMOD(2, n - 1), m - 1);
}
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  cout << solve(n, m, k) << endl;
  return 0;
}
