Language: C++

#include <iostream>
using namespace std;

#define check {
   cnt=0;
   for(j=0;j<6;j++)if(d1[j]==d2[j])cnt++;
 }

int main(){
 int d1[6],d2[6],tmp,cnt,j,a=1;

 for(int i=0;i<6;i++){
  cin >> d1[i] ;
 }
 for(int i=0;i<6;i++){
  cin >> d2[i] ;
 }

 check
   if(cnt==6)a=0;

 while(a){
 for(int i=0;i<5;i++){
  for(int k=0;k<4;k++){
 check
   if(cnt==6)break;
   tmp=d2[1];
   d2[1]=d2[3];
   d2[3]=d2[4];
   d2[4]=d2[2];
   d2[2]=tmp;
  }
 check
   if(cnt==6)break;
  tmp=d2[0];
  d2[0]=d2[1];
  d2[1]=d2[5];
  d2[5]=d2[4];
  d2[4]=tmp;
 }
 
 check
   if(cnt==6)break;

  tmp=d2[0]; 
  d2[0]=d2[3];
  d2[3]=d2[5];
  d2[5]=d2[2];
  d2[2]=tmp;

  for(int k=0;k<4;k++){
 check
   if(cnt==6)break;
   tmp=d2[1];
   d2[1]=d2[3];
   d2[3]=d2[4];
   d2[4]=d2[2];
   d2[2]=tmp;
  }
 
 check
   if(cnt==6)break;

  tmp=d2[0]; 
  d2[0]=d2[3];
  d2[3]=d2[5];
  d2[5]=d2[2];
  d2[2]=tmp;
  tmp=d2[0]; 
  d2[0]=d2[3];
  d2[3]=d2[5];
  d2[5]=d2[2];
  d2[2]=tmp;

  for(int k=0;k<4;k++){
 check
   if(cnt==6)break;
   tmp=d2[1];
   d2[1]=d2[3];
   d2[3]=d2[4];
   d2[4]=d2[2];
   d2[2]=tmp;
  }
 check
   if(cnt==6)break;
   a=0;
 }


 if(cnt==6)cout << "Yes" << endl ;
 else cout << "No" << endl ;

 return 0;
}

Compiler output:
a.cc:5:4: error: 'cnt' does not name a type; did you mean 'int'?
    5 |    cnt=0;
      |    ^~~
      |    int
a.cc:6:4: error: expected unqualified-id before 'for'
    6 |    for(j=0;j<6;j++)if(d1[j]==d2[j])cnt++;
      |    ^~~
a.cc:6:12: error: 'j' does not name a type
    6 |    for(j=0;j<6;j++)if(d1[j]==d2[j])cnt++;
      |            ^
a.cc:6:16: error: 'j' does not name a type
    6 |    for(j=0;j<6;j++)if(d1[j]==d2[j])cnt++;
      |                ^
a.cc:7:2: error: expected declaration before '}' token
    7 |  }
      |  ^
a.cc: In function 'int main()':
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | #define check {
      |               ^
a.cc:61:2: note: in expansion of macro 'check'
   61 |  check
      |  ^~~~~
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:51:23: note: to match this '{'
   51 |   for(int k=0;k<4;k++){
      |                       ^
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | #define check {
      |               ^
a.cc:42:2: note: in expansion of macro 'check'
   42 |  check
      |  ^~~~~
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:24:23: note: to match this '{'
   24 |   for(int k=0;k<4;k++){
      |                       ^
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:23:22: note: to match this '{'
   23 |  for(int i=0;i<5;i++){
      |                      ^
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:22:10: note: to match this '{'
   22 |  while(a){
      |          ^
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:4:15: note: to match this '{'
    4 | #define check {
      |               ^
a.cc:19:2: note: in expansion of macro 'check'
   19 |  check
      |  ^~~~~
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^