#include <bits/stdc++.h>
using namespace std;
long long int const mod = 1000000007;
long long int power(long long int base, long long int pw) {
  if (pw == 1) {
    return base % mod;
  }
  if (pw == 0) {
    return 1;
  }
  if (pw % 2 == 1) {
    long long int temp = power(base, pw / 2) % mod;
    return (temp * temp) % mod * base % mod;
  }
  if (pw % 2 == 0) {
    long long int temp = power(base, pw / 2) % mod;
    return (temp * temp) % mod;
  }
}
int main(void) {
  ios_base::sync_with_stdio(false);
  long long int n, m, k;
  while (cin >> n >> m >> k) {
    if (k == -1 && (n % 2 != m % 2)) {
      cout << 0 << '\n';
      continue;
    }
    if (m > n) {
      long long int temp = m;
      m = n;
      n = temp;
    }
    long long int newbase = power(2, n - 1);
    long long int fin = power(newbase, m - 1) % mod;
    cout << fin << '\n';
  }
}
