Language: C++

#include<string>
using namespace std;
class dice {
public:
	int a[6];
	int b;
	void moveN() {
		b = a[0];
		a[0] = a[1];
		a[1] = a[5];
		a[5] = a[4];
		a[4] = b;
	}
	void moveS() {
		b = a[0];
		a[0] = a[4];
		a[4] = a[5];
		a[5] = a[1];
		a[1] = b;
	}
	void moveE() {
		b = a[0];
		a[0] = a[3];
		a[3] = a[5];
		a[5] = a[2];
		a[2] = b;
	}
	void moveW() {
		b = a[0];
		a[0] = a[2];
		a[2] = a[5];
		a[5] = a[3];
		a[3] = b;
	}
	void moveR() {
		b = a[1];
		a[1] = a[2];
		a[2] = a[4];
		a[4] = a[3];
		a[3] = b;
	}
	void moveL() {
		b = a[1];
		a[1] = a[3];
		a[3] = a[4];
		a[4] = a[2];
		a[2] = b;
	}
};
int main() {

	int a = 0;

	dice dice1, dice2;
	for (int i = 0; i < 6; i++) {
		cin >> dice1.a[i];
	}
	for (int i = 0; i < 6; i++) {
		cin >> dice2.a[i];
	}

	if (dice1.a[2] == dice2.a[2] && dice1.a[3] == dice2.a[3] && dice1.a[4] == dice1.a[4] && dice1.a[0] == dice2.a[0] && dice1.a[1] == dice1.a[1]) {
		cout << "Yes" << endl;
		return 0;
	}
	for (int i = 0; i < 6; i++) {
		if (dice1.a[0] == dice2.a[i]) {
			dice2.moveE();
			dice2.moveE();
			if (dice1.a[5] == dice2.a[i]) {
				a = 1;
			}
			else {
				cout << "No" << endl;
			}
		}
	}

	if (a == 1) {
		for (int i = 0; i < 4; i++) {
			dice2.moveE();
			if (dice1.a[0] == dice2.a[0]) {
				a = 2;
			}
		}
	}

	if (a == 1) {
		for (int i = 0; i < 4; i++) {
			dice2.moveN();
			if (dice1.a[0] == dice2.a[0]) {
				a = 2;
			}
		}
	}

	if (a == 2) {
		if (dice1.a[2] == dice2.a[2] && dice1.a[3] == dice2.a[3] && dice1.a[4] == dice1.a[4]) {
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:17: error: 'cin' was not declared in this scope
   56 |                 cin >> dice1.a[i];
      |                 ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:59:17: error: 'cin' was not declared in this scope
   59 |                 cin >> dice2.a[i];
      |                 ^~~
a.cc:59:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:63:17: error: 'cout' was not declared in this scope
   63 |                 cout << "Yes" << endl;
      |                 ^~~~
a.cc:63:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:63:34: error: 'endl' was not declared in this scope
   63 |                 cout << "Yes" << endl;
      |                                  ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<string>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:74:33: error: 'cout' was not declared in this scope
   74 |                                 cout << "No" << endl;
      |                                 ^~~~
a.cc:74:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:74:49: error: 'endl' was not declared in this scope
   74 |                                 cout << "No" << endl;
      |                                                 ^~~~
a.cc:74:49: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:99:25: error: 'cout' was not declared in this scope
   99 |                         cout << "Yes" << endl;
      |                         ^~~~
a.cc:99:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:99:42: error: 'endl' was not declared in this scope
   99 |                         cout << "Yes" << endl;
      |                                          ^~~~
a.cc:99:42: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:104:9: error: 'cout' was not declared in this scope
  104 |         cout << "No" << endl;
      |         ^~~~
a.cc:104:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:104:25: error: 'endl' was not declared in this scope
  104 |         cout << "No" << endl;
      |                         ^~~~
a.cc:104:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'