#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long QuickPow(long long p, long long q) {
  long long cnt = 1;
  while (q > 0) {
    if (q % 2 == 1) cnt = (cnt * p) % mod;
    p = (p * p) % mod;
    q /= 2;
  }
  return cnt;
}
long long n, m, ans;
int k;
int main() {
  int i, j;
  cin >> n >> m >> k;
  if (k == -1 && (n + m) % 2 == 1) {
    cout << "0" << endl;
    return 0;
  }
  ans = QuickPow(2, n - 1);
  ans = QuickPow(ans, m - 1);
  cout << ans << endl;
  return 0;
}
