#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using LD = long double;
const LL INF = 0x3f3f3f3f;
const LL mod = 1e9 + 7;
LL PowMod(LL a, LL n) {
  LL ans = 1;
  while (n) {
    if (n & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    n >>= 1;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  LL n, m, k;
  cin >> n >> m >> k;
  if (k == -1 && n % 2 != m % 2)
    cout << "0\n";
  else
    cout << PowMod(PowMod(2, (n - 1)), m - 1) << '\n';
}
