Problem description

The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a little: it is spelled (and pronounced) reversely. For example, a Berlandish word code corresponds to a Birlandish word edoc. However, it's easy to make a mistake during the «translation». Vasya translated word s from Berlandish into Birlandish as t. Help him: find out if he translated the word correctly.

Input

The first line contains word s, the second line contains word t. The words consist of lowercase Latin letters. The input data do not consist unnecessary spaces. The words are not empty and their lengths do not exceed 100 symbols.

Output

If the word t is a word s, written reversely, print YES, otherwise print NO.

Examples

Input

code
edoc

Output

YES

Input

abb
aba

Output

NO

Input

code
code

Output

NO
解题思路:检查第一个字符串反转之后是否和第二个字符串相等,是为"YES",否则为"NO"。
AC代码:
 #include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
reverse(s.begin(),s.end());
if(t==s)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return ;
}

最新文章

  1. 队列送券的实际应用--ConcurrentLinkedQueue并发队列
  2. Unity全屏模糊
  3. linux cpu性能测试
  4. iOS平台网络类型检测
  5. HDU 3951 (博弈) Coin Game
  6. linux file命令小记
  7. 二叉搜索树算法详解与Java实现
  8. SqlServer取得一个月的所有有日期
  9. 跨浏览器resize事件分析
  10. Unity3d 物体沿着正七边形轨迹移动
  11. [刷题]算法竞赛入门经典(第2版) 4-9/UVa1591 - Data Mining
  12. 【Azkaban搭建】---Azkaban 3.25.0搭建细则 超实用
  13. 【Python实践-2】求一个或多个数的乘积
  14. Eclipse工具常用快捷键
  15. Java 208 道面试题:第一模块答案
  16. Jenkins安装及基本配置(Linux版,使用web容器 tomcat 搭建)
  17. sublime text 3搭建python
  18. Fragment传参
  19. 量化交易(Quantitative Trading)
  20. ELK Deployed

热门文章

  1. Matlab数组创建
  2. react基础篇一
  3. JSP_内置对象_out
  4. SQL 分组
  5. redis与其可视化工具在win7上的安装
  6. SPLAY or SPALY ?
  7. eas之编码规则&amp;单据转换规则
  8. 【剑指Offer】37、数字在排序数组中出现的次数
  9. Linux基础:seq命令总结
  10. [vuejs短文]使用vue-transition制作小小轮播图