#include <bits/stdc++.h>
const long long mod = 1000000007;
int Inf = (int)2e9;
using namespace std;
int p[8][8];
bool chech(int x, int y) {
  if (p[x][2] == 1 && p[x][3] == 1 && p[x][4] == 1) return true;
  if (p[x][5] == 1 && p[x][3] == 1 && p[x][4] == 1) return true;
  if (p[2][y] == 1 && p[3][y] == 1 && p[4][y] == 1) return true;
  if (p[5][y] == 1 && p[3][y] == 1 && p[4][y] == 1) return true;
  if (p[x - 1][y - 1] == 1 && p[x - 2][y - 2] == 1) return true;
  if (p[x - 1][y - 1] == 1 && p[x + 1][y + 1] == 1) return true;
  if (p[x + 2][y + 2] == 1 && p[x + 1][y + 1] == 1) return true;
  if (p[x - 1][y + 1] == 1 && p[x - 2][y + 2] == 1) return true;
  if (p[x - 1][y + 1] == 1 && p[x + 1][y - 1] == 1) return true;
  if (p[x + 1][y - 1] == 1 && p[x + 2][y - 2] == 1) return true;
  return false;
}
int main() {
  memset(p, 0, sizeof(p));
  for (int i = 2; i < 6; i++) {
    for (int j = 2; j < 6; j++) {
      char c;
      cin >> c;
      if (c == 'x')
        p[i][j] = 1;
      else if (c == 'o')
        p[i][j] = -1;
    }
  }
  for (int i = 2; i < 6; i++) {
    for (int j = 2; j < 6; j++) {
      if (p[i][j] == 0) {
        p[i][j] = 1;
        if (chech(i, j)) {
          puts("YES");
          exit(0);
        }
        p[i][j] = 0;
      }
    }
  }
  puts("NO");
  return 0;
}
