#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm> 
using namespace std;
const int maxn = 1100;

int main()
{
	char s[maxn], t[maxn];
	cin >> s >> t;
	int len;
	len = strlen(s);
	int flag = 0;
	int count = 0;
	while(count < len)
	{
		reverse(s , s + len - 1);
		reverse(s, s + len);
		if(strcmp(s, t) == 0)
		{
			flag = 1;
			break;
		}
		count++;
	}
	if(flag == 1){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}

	
	return 0;
}