#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[5];
  for (long long int i = 0; i < 4; i++) cin >> s[i];
  long long int f = 0;
  for (long long int i = 0; i <= 3; i++) {
    for (long long int j = 0; j <= 3; j++) {
      if (j <= 1) {
        if (s[i][j] == 'x' and s[i][j + 1] == 'x' and s[i][j + 2] == '.') {
          f = 1;
          break;
        }
        if (s[i][j] == '.' and s[i][j + 1] == 'x' and s[i][j + 2] == 'x') {
          f = 1;
          break;
        }
        if (s[i][j] == 'x' and s[i][j + 1] == '.' and s[i][j + 2] == 'x') {
          f = 1;
          break;
        }
      }
      if (i <= 1) {
        if (s[i][j] == 'x' and s[i + 1][j] == 'x' and s[i + 2][j] == '.') {
          f = 1;
          break;
        }
        if (s[i][j] == 'x' and s[i + 1][j] == '.' and s[i + 2][j] == 'x') {
          f = 1;
          break;
        }
        if (s[i][j] == '.' and s[i + 1][j] == 'x' and s[i + 2][j] == 'x') {
          f = 1;
          break;
        }
      }
      if (i <= 1 and j <= 1) {
        if (s[i][j] == 'x' and s[i + 1][j + 1] == 'x' and
            s[i + 2][j + 2] == '.') {
          f = 1;
          break;
        }
        if (s[i][j] == '.' and s[i + 1][j + 1] == 'x' and
            s[i + 2][j + 2] == 'x') {
          f = 1;
          break;
        }
        if (s[i][j] == 'x' and s[i + 1][j + 1] == '.' and
            s[i + 2][j + 2] == 'x') {
          f = 1;
          break;
        }
      }
      if (i >= 2 and j <= 1) {
        if (s[i][j] == 'x' and s[i - 1][j + 1] == 'x' and
            s[i - 2][j + 2] == '.') {
          f = 1;
          break;
        }
        if (s[i][j] == '.' and s[i - 1][j + 1] == 'x' and
            s[i - 2][j + 2] == 'x') {
          f = 1;
          break;
        }
        if (s[i][j] == 'x' and s[i - 1][j + 1] == '.' and
            s[i - 2][j + 2] == 'x') {
          f = 1;
          break;
        }
      }
    }
  }
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
