#include <bits/stdc++.h>
using namespace std;
class Solution {
 private:
  long long MOD = 1000000007;
  long long n, m, k;
  long long answer(long long n, long long m, long long k) {
    if (k < 0 && (n % 2 != m % 2)) return 0;
    long long base = 2;
    long long exp = ((n - 1) % (MOD - 1)) * ((m - 1) % (MOD - 1)) % (MOD - 1);
    long long ans = 1;
    while (exp > 0) {
      if (exp & 1) ans = (ans * base) % MOD;
      base = (base * base) % MOD;
      exp >>= 1;
    }
    return ans;
  }

 public:
  void solve(std::istream& in, std::ostream& out) {
    in >> n >> m >> k;
    out << answer(n, m, k);
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
