#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <cassert>
#include <iostream>
#include <stdio.h>
#include <time.h>
 
using namespace std;

typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)

#define MOD 1000000007

long long modpow(long long a, long long b){ 
  long long r = 1LL;
  while(b){
    if(b & 1LL)r *= a;
    if(r >= MOD)r %= MOD;
    a *= a;
    if(a >= MOD)a %= MOD;
    b >>= 1LL;
  }
  return r%MOD;
}

ll d1[2010][2010];
ll d2[2010][2010];
ll d3[2010][2010];
ll d4[2010][2010];

int main(){
  ll h,w;
  cin>>h>>w;
  vector<string> vs;
  ll sp = 0;
  rep(y,0,h){
    string s;
    cin>>s;
    vs.pb(s);
  }
  // 1
  rep(x,0,w){
    ll c = 0;
    rep(y,0,h){
      if(vs[y][x]=='#'){
        c=0;
      }
      else{
        sp++;
        d1[y][x]=c;
        c++;
      }
    }
  }
  // 2
  rep(x,0,w){
    ll c = 0;
    per(y,0,h){
      if(vs[y][x]=='#'){
        c=0;
      }
      else{
        d2[y][x]=c;
        c++;
      }
    }
  }
  // 3
  rep(y,0,h){
    ll c = 0;
    rep(x,0,w){
      if(vs[y][x]=='#'){
        c=0;
      }
      else{
        d3[y][x]=c;
        c++;
      }
    }
  }
  // 4
  rep(y,0,h){
    ll c = 0;
    per(x,0,w){
      if(vs[y][x]=='#'){
        c=0;
      }
      else{
        d4[y][x]=c;
        c++;
      }
    }
  }
  ll ans = 0;
  rep(y,0,h){
    rep(x,0,w){
      if(vs[y][x]=='.'){
        ll a = d1[y][x] + d2[y][x] + d3[y][x] + d4[y][x] + 1;
      ll c = 1;
      c *= modpow(2,sp-a);
      c %= MOD;
      c *= modpow(2,a)+MOD-1;
      c %= MOD;
      ans += c;
      ans %= MOD;
    }
    }
  }
  cout << ans << endl;
  return 0;
}
#include <bits/stdc++.h>
#include <chrono>

using namespace std;
using namespace chrono;

typedef long long int ll;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define pb push_back
#define odd(x) ((x)&1)
#define even(x) (!odd(x))
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(auto i=0;i<n;++i)
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define TEST_CASE int tc;cin>>tc;while(tc--)
#define Clock high_resolution_clock::now()

template<class T>
inline bool chmax(T &a, T b) {if(a < b) {a = b;return true;}return false;}
template<class T>
inline bool chmin(T &a, T b) {if(a > b) {a = b;return true;}return false;}

#ifdef LOCAL
#define cerr cout
#else
#endif

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}


template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
// #define TIME

/******************************************************************************************************************************/


const ll inf = 2e18;
const ll mod = 998244353;
const ll N = 2e3;


void prt(vll &v) {
    cout << v.size() << " ";
    for(auto i: v) cout << i << " ";
    cout << "\n";
}

int main()
{
    auto start_time = Clock;
    FASTIO

    
    ll n;
    cin >> n;
    vll v(n);
    rep(i,n) cin >> v[i];

    map<ll, vector<vll> > mp;

    ll m = min(8ll,n);

    rep(i,1<<m) {
        if(!i) continue;
        vll tmp;
        ll sum = 0;
        for(ll j=0;j<m;++j) {
            if(i&(1<<j)) {
                sum += v[j]; sum %= 200;
                tmp.pb(j+1);
            }
        }
        // cout << bitset<4>(i) << " " << sum << "\n";
        mp[sum].pb(tmp);
    }

    for(auto p: mp) {
        if(p.second.size()>1) {
            cout << "Yes\n";
            // trace(p.first);
            prt(p.second[0]), prt(p.second[1]);
            return 0;
        }
    }
    cout << "No\n";


    


    auto end_time = Clock;
    #ifndef TIME
        return 0;
    #endif
    cout << "\nTime elapsed: "
    << (double)duration_cast<milliseconds>(end_time-start_time).count() 
    << "ms";


    return 0;
}