#include <bits/stdc++.h>
using namespace std;
long long po(long long x, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1)
      result = ((result % 1000000007) * (x % 1000000007)) % 1000000007;
    x = ((x % 1000000007) * (x % 1000000007)) % 1000000007;
    n = n / 2;
  }
  return result;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, p = 0, q = 0, l = 0, i, flag = 0, k, j, t, r = 0, curr = 0, d;
  cin >> n >> m >> k;
  if (n % 2 != m % 2 && k == -1) {
    cout << 0;
    return 0;
  }
  cout << po(po(2, n - 1), m - 1);
  return 0;
}
