#include <bits/stdc++.h>
using namespace std;

#define gap " "
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ok cout<<"ok"<<endl
#define DBG(a) cerr<< "Line "<<__LINE__ <<" : "<< #a <<" = "<<(a)<<endl
#define fastio {ios_base::sync_with_stdio(false);cin.tie(NULL);}

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

const int N=100009;
const int mod=1e9+7;

ll dp[2002][2002][4];
                  //0 ->total sum
                  //1->Horizontal prefix sum
                  //2->Vertical prefix sum
                  //3-> Corner Prefix sum
vector<string> vec; 
int main()
{

    string s;
    int row,col,i,j,k;

    cin>>row>>col;
    for(i=0; i<row; i++){
        cin>>s;
        vec.pb(s);
    }
    int wallH=1,wallV=1,wallC=1;
    ll sum;
    for(i=1; i<=row; i++){
        for(j=1; j<=col; j++){
            for(k=0; k<4; k++) dp[i][j][k]=0;

            if(i==1 && j==1) continue;

            if(vec[i-1][j-1]=='.'){
                sum=dp[i][j-1][1]+dp[i-1][j][2]+dp[i-1][j-1][3];
                if(i==1) sum+=wallH;
                else if(j==1) sum+=wallV;
                else if(i==j) sum+=wallC;
                sum=sum%mod;
                dp[i][j][0]=sum;
                dp[i][j][1]=(dp[i][j-1][1]+sum)%mod;
                dp[i][j][2]=(dp[i-1][j][2]+sum)%mod;
                dp[i][j][3]=(dp[i-1][j-1][3]+sum)%mod;
            }
            else{
                if(i==1) wallH=0;
                else if(j==1) wallV=0;
                else if(i==j) wallC=0;
            }
        }
    }
    cout<<dp[row][col][0]%mod<<'\n';
    return 0;
}
#include <bits/stdc++.h>

using namespace std;

int solve(long long* available, int n, long long k) {
    if (available[n - 1] < k) {
        return -1;
    }

    int l = 0, r = n - 1;

    while (l < r) {
        int middle = l + (r - l) / 2;

        if (available[middle] >= k) {
            if (available[middle - 1] < k) {
                return middle;
            }

            r = middle - 1;
        } else {
            l = middle + 1;
        }
    }

    return l;
}

int main() {
    int n, q;

    cin >> n >> q;

    auto available = new long long[n];
    auto not_available = new long long[n];

    cin >> not_available[0];

    available[0] = not_available[0] - 1;

    int i;

    for (i = 1; i < n; i++) {
        cin >> not_available[i];

        available[i] =
            available[i - 1] + not_available[i] - not_available[i - 1] - 1;
    }

    long long k;

    for (i = 0; i < q; i++) {
        cin >> k;

        auto solution = solve(available, n, k);

        if (solution == -1) {
            cout << not_available[n - 1] + k - available[n - 1];
        } else {
            cout << not_available[solution] - (available[solution] - k) - 1;
        }

        cout << '\n';
    }
}
