#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int main(){
  vector<vector<char>> s(3,vector<char>(3));
  rep(i,3) rep(j,3) cin >> s[i][j];
  bool can = true;
  for (int i = 0; i < 3;i++){
    for (int j = 0; j < 3;j++){
      if ((i+j)%2 == 0 && s[i][j] == '.') continue;
      else if ((i+j)%2 == 1 && s[i][j] == '#') continue;
      else{
        can = false;
        break;
      }
    }
  }
  if (can){
    cout << "Yes" << endl;
    return 0;
  }
  can = true;
   for (int i = 0; i < 3;i++){
    for (int j = 0; j < 3;j++){
      if ((i+j)%2 == 0 && s[i][j] == '#') continue;
      else if ((i+j)%2 == 1 && s[i][j] == '.') continue;
      else{
        can = false;
        break;
      }
    }
  }
  if (can) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}