#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const double EPS = 1e-9;
const long long MOD = (long long)(1e9 + 7);
const long long MAXV = (long long)(5e4 + 10);
const long long MAXE = (long long)(3e4 + 10);
char mat[5][5];
int cf[] = {-1, -1, -1, 0, 1, 1, 1, 0};
int cc[] = {-1, 0, 1, 1, 1, 0, -1, -1};
bool walk(int a, int b, int k) {
  int cont = 0;
  int equis = 0;
  while (1) {
    if (a >= 4 || a < 0 || b >= 4 || b < 0 || cont >= 3) break;
    if (mat[a][b] == 'x') equis++;
    a = a + cf[k];
    b = b + cc[k];
    cont++;
  }
  return equis == 3;
}
bool check(int a, int b) {
  mat[a][b] = 'x';
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 8; k++) {
        if (walk(i, j, k)) {
          mat[a][b] = '.';
          return true;
        }
      }
    }
  mat[a][b] = '.';
  return false;
}
bool vacio = true;
int main() {
  for (int i = 0; i < 4; i++) scanf("%s", &mat[i]);
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      if (mat[i][j] != '.') vacio = false;
      if (mat[i][j] == '.')
        if (check(i, j)) {
          printf("YES\n");
          return 0;
        }
    }
  printf("NO\n");
  return 0;
}
