Language: C++

#include <bits/stdc++.h>
#include <vector>
using namespace std;
 
int main(void){
    int H, W, a;
    a = 1;
    cin >> H >> W;
    vector<vector<int>> b;
    b = vector<vector<int>>(W, vector<int>(H, 0));
	for(int i=0; i<W; i++){
    	for(int j=0; j<H; j++){
        	char x;
            cin >> x;
            if(x == "#"){
            	b[i][j] = 1;
            }else if(x == "."){
            	b[i][j] = 0;
            }
        }
    }
    for(int i=0; i<W; i++){
        for(int j=0; j<H; j++){
            if(b[i][j] == 1){
                if(i == 0 && j == 0 && b[i+1][j] == 0 && b[i][j+1] == 0){
                    a = 0;
                    break;
                }else if(i == W-1 && j == H-1 && b[i-1][j] == 0 && b[i][j+1] == 0){
                    a = 0
                    break;
                }else if(i == 0 && j == H-1 && b[i+1][j] == 0 && b[i][j-1] == 0){
                    a = 0
                    break;
                }else if(i == W-1 && j == 0 && b[i][j+1] == 0 && b[i-1][j] == 0){
                    a = 0;
                    break;
                }else if(i == 0 && b[i][j+1] == 0 && b[i][j-1] == 0 && b[i+1][j] = 0){
                    a = 0;
                    break;
                }else if(j == 0 && b[i][j+1] == 0 && b[i-1][j] == 0 && b[i+1][j] = 0){
                    a = 0;
                    break;
                }else if(i == W-1 && b[i][j-1] == 0 && b[i-1][j] == 0 && b[i][j+1] = 0){
                    a = 0;
                    break;
                }else if(j == H-1 && b[i][j-1] == 0 && b[i-1][j] == 0 && b[i+1][j] = 0){
                    a = 0;
                    break;
                }else if(b[i][j+1] == 0 && b[i][j-1] == 0 && b[i-1][j] == 0 && b[i+1][j] = 0){
                    a = 0;
                    break;
                }
            }
        }
    }
    if(a == 0){
        cout << "No";
    }else if(a == 1){
        cout << "Yes";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |             if(x == "#"){
      |                ~~^~~~~~
a.cc:17:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |             }else if(x == "."){
      |                      ~~^~~~~~
a.cc:29:26: error: expected ';' before 'break'
   29 |                     a = 0
      |                          ^
      |                          ;
   30 |                     break;
      |                     ~~~~~ 
a.cc:32:26: error: expected ';' before 'break'
   32 |                     a = 0
      |                          ^
      |                          ;
   33 |                     break;
      |                     ~~~~~ 
a.cc:37:69: error: lvalue required as left operand of assignment
   37 |                 }else if(i == 0 && b[i][j+1] == 0 && b[i][j-1] == 0 && b[i+1][j] = 0){
a.cc:40:69: error: lvalue required as left operand of assignment
   40 |                 }else if(j == 0 && b[i][j+1] == 0 && b[i-1][j] == 0 && b[i+1][j] = 0){
a.cc:43:71: error: lvalue required as left operand of assignment
   43 |                 }else if(i == W-1 && b[i][j-1] == 0 && b[i-1][j] == 0 && b[i][j+1] = 0){
a.cc:46:71: error: lvalue required as left operand of assignment
   46 |                 }else if(j == H-1 && b[i][j-1] == 0 && b[i-1][j] == 0 && b[i+1][j] = 0){
a.cc:49:77: error: lvalue required as left operand of assignment
   49 |                 }else if(b[i][j+1] == 0 && b[i][j-1] == 0 && b[i-1][j] == 0 && b[i+1][j] = 0){