#include <bits/stdc++.h>
char s[10][10];
bool check() {
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 2; j++) {
      if (s[i][j] == 'x' && s[i][j + 1] == 'x' && s[i][j + 2] == 'x') {
        return 1;
      }
    }
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 4; j++) {
      if (s[i][j] == 'x' && s[i + 1][j] == 'x' && s[i + 2][j] == 'x') {
        return 1;
      }
    }
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      if (s[i][j] == 'x' && s[i + 1][j + 1] == 'x' && s[i + 2][j + 2] == 'x') {
        return 1;
      }
      if (s[i][j + 2] == 'x' && s[i + 1][j + 1] == 'x' && s[i + 2][j] == 'x') {
        return 1;
      }
    }
  }
  return 0;
}
bool solve() {
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (s[i][j] == '.') {
        s[i][j] = 'x';
        if (check()) {
          return 1;
        }
        s[i][j] = '.';
      }
    }
  }
  return 0;
}
int main() {
  scanf("%s%s%s%s", s[0], s[1], s[2], s[3]);
  puts(solve() ? "YES" : "NO");
  return 0;
}
