#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  long long n, m, k;
  cin >> n >> m >> k;
  if (k == -1 && n % 2 + m % 2 == 1) {
    cout << "0" << endl;
  } else {
    n = (n - 1) % (MOD - 1);
    m = (m - 1) % (MOD - 1);
    long long b = n * m;
    long long x = 2, ans = 1;
    while (b) {
      if (b & 1) ans = ans * x % MOD;
      x = x * x % MOD;
      b >>= 1;
    }
    cout << ans << endl;
  }
}
