/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n)  FOR(i,0,(n))
typedef pair<int,int> P;


class CGridRepainting2 {
public:
	void solve(std::istream& in, std::ostream& out) {
    int h,w;
    in >> h >> w;
    vector<vector<char>> s(h, vector<char>(w));
    REP(i,h)REP(j,w){
      in >> s[i][j];
    }
    vector<P> action = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
    REP(i,h) REP(j,w){
      if(s[i][j] == '#') {
        bool f = false;
        for (P p : action) {
          if (i + p.first >= 0 && i + p.first < h && j + p.second >= 0 && j + p.second < w) {
            f |= s[i + p.first][j + p.second] == '#';
          }
        }
        if (!f) {
          out << "No" << endl;
          return;
        }
      }
    }
    out << "Yes" << endl;
	}
};


signed main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout << fixed;
	CGridRepainting2 solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

#include <cstdio>
#include <string>
#include <algorithm>

using namespace std;

int main() {
    char buf[1<<10];
    size_t q;
    scanf("%s %zu", buf, &q);
    string str(buf);

    for (size_t i=0; i<q; ++i) {
        size_t a, b;
        scanf("%s %zu %zu", buf, &a, &b);
        string instr(buf);

        if (instr == "print") {
            printf("%s\n", str.substr(a, b-a+1).c_str());
        } else if (instr == "reverse") {
            reverse(str.begin()+a, str.begin()+b+1);
        } else if (instr == "replace") {
            scanf("%s", buf);
            string p(buf);
            str.replace(a, b-a+1, p);
        }
    }

    return 0;
}