#include <bits/stdc++.h>
using namespace std;
const long long inf = 9.2e18;
const int maxn = 4007;
const int INF = 2.1e9;
const int MOD = 1e9 + 7;
const double eps = 1e-7;
const double PI = acos(-1.0);
long long n, m, k;
long long pow_mod(long long x, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = (ans * x) % MOD;
    x = (x * x) % MOD;
    n >>= 1;
  }
  return ans;
}
int main() {
  while (cin >> n >> m >> k) {
    if (k == -1 && ((n & 1) != (m & 1)))
      cout << 0 << endl;
    else
      cout << pow_mod(pow_mod(2, n - 1), m - 1) << endl;
  }
  return 0;
}
