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

typedef long long ll;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a,x) for (auto& a : x)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

const char nl = '\n';

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
    int h, w; cin >> h >> w;
    int canvas[h + 2][w + 2];
    FOR(i, 1, h + 1) {
        string s; cin >> s;
        FOR(j, 1, w + 1) canvas[i][j] = s[j];
    }
    bool ok = true;
    F0R(i, h) {
        F0R(j, w) {
            if (canvas[i][j] == '#') {
                if (canvas[i+1][j] == '.' && canvas[i - 1][j] == '.' && canvas[i][j + 1] == '.' && canvas[i][j - 1] == '.') {
                    ok = false;
                    break;
                }
            }
        }
    }
    cout << (ok ? "Yes\n": "No\n");
}
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
// #define INF __INT32_MAX__
#define INF 1e9
#define LINF __LONG_LONG_MAX__

int main() {
    int K, T; cin >> K >> T;
    vi A(T); rep(i, T) cin >> A[i];

    sort(A.begin(), A.end());
    reverse(A.begin(), A.end());

    int x = A[0];
    for (int i = 1; i < T; i++) {
        x -= A[i];
    }

    if (x > 0) {
        cout << (x - 1) << endl;
    } else {
        cout << 0 << endl;
    }
}
