#include <bits/stdc++.h>
using namespace std;
static const int INF = 1e+9 + 7;
long long n, m, l;
string s, t;
long long d[200010], dp[300][300];
char field[200][200];
int main() {
  cin >> n >> m;
  for (long long i = (0); i < (n); i++)
    for (long long j = (0); j < (m); j++) cin >> field[i][j];
  if (field[0][0] == '.' && field[0][0] == field[0][m - 1] &&
      field[n - 1][0] == field[0][0] && field[0][0] == field[n - 1][m - 1])
    cout << ("Yes") << "\n";
  else
    puts("No");
  return 0;
}
