#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
const int mod = 1e9 + 7;
int power(int a,int b)
{
int ans=1;
for (;b;b>>=1, a=a*a%mod)
if (b&1) ans=ans*a%mod;
return ans;
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(NULL), cout.tie(NULL);
map<int,array<bool,2>> mp, mp1;
int n,m,k;
cin>>n>>m>>k;
int sub=1, sub1=1;
for (int i=0;i<k;i++)
{
char c;
cin>>c;
int x,y;
cin>>x>>y;
if (x%2)
{
if (c=='-') mp1[y][0]=1;
else mp1[y][1]=1;
}
else
{
if (c=='+') mp1[y][0]=1;
else mp1[y][1]=1;
}
if (y%2)
{
if (c=='-') mp[x][0]=1;
else mp[x][1]=1;
}
else
{
if (c=='+') mp[x][0]=1;
else mp[x][1]=1;
}
if ((x+y)%2!=(c=='+')) sub=0;
if((x+y)%2!=(c=='-')) sub1=0;
}
int val=power(2,n-mp.size()), val1=power(2,m-mp1.size());
for (auto [x,e]:mp)
val=val*(2-e[0]-e[1])%mod;
for (auto [x,e]:mp1)
val1=val1*(2-e[0]-e[1])%mod;
int ans=val+val1-sub-sub1+mod;
cout<<ans%mod<<endl;
return 0;
}