#include <bits/stdc++.h>
using namespace std;
long long expo(long long base, long long exponent, long long mod) {
  long long ans = 1;
  while (exponent != 0) {
    if ((exponent & 1) == 1) {
      ans = ans * base;
      ans = ans % mod;
    }
    base = base * base;
    base %= mod;
    exponent >>= 1;
  }
  return ans % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  if (k == -1 and (n + m) % 2) {
    cout << 0;
    return 0;
  }
  cout << expo(2, 1LL * ((n - 1) % 1000000006) * ((m - 1) % 1000000006),
               1000000007);
  return 0;
}
