#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long double PI = acos((long double)-1);
long long power(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) {
      res = (res * x) % MOD;
    }
    n = n / 2;
    x = (x * x) % MOD;
  }
  return res;
}
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  if (k == -1 && n % 2 != m % 2) {
    cout << 0 << '\n';
  } else {
    long long ans = power(power(2, n - 1), m - 1);
    cout << ans << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
