#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
const long long N = 1e5 + 5;
long long powmod(long long x, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
void solve() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long checker = (n & 1LL) ^ (m & 1LL);
  if (checker && k == -1) {
    cout << 0 << "\n";
    return;
  }
  long long ans = powmod(2, n - 1);
  ans = powmod(ans, m - 1);
  cout << ans << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  ;
  long long tc = 1;
  for (long long t = 1; t <= tc; t++) {
    solve();
  }
}
