#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long power(long long a, long long b) {
  a %= mod;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return ans;
}
int main() {
  long long n, m, k;
  while (cin >> n >> m >> k) {
    if (n % 2 != m % 2 && k == -1)
      cout << 0 << endl;
    else
      cout << power(power(2, m - 1), n - 1) << endl;
  }
  return 0;
}
