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.
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.
def Bitplus():
    n = int(input())
    x = 0
    for i in range(n):
        a = input()
        if "+" in a:
            x += 1
        else:
            x -= 1
    print(x)

def GiftSetidk():
    n = int(input())
    for i in range(n):
        all = input().split(" ")
        x = int(all[0])
        y = int(all[1])
        a = int(all[2])
        b = int(all[3])
        counter = 0
        count = True
        while count:
            if x >= a and y >= b:
                x -= a
                y -= b
                counter += 1
            elif x >= b and y >= a:
                x -= b
                y -= a
                counter += 1
            else:
                count = False
        print(counter)


def Team():
    n = int(input())
    problemcount = 0
    for i in range(n):
        count = 0
        answer = input().split(" ")
        for i in range(len(answer)):
            answer[i] = int(answer[i])
        for i in answer:
            if i == 1:
                count += 1
        if count >= 2:
            problemcount += 1
    print(problemcount)

def NextRound():
    nk = input().split(" ")
    n = int(nk[0])
    k = int(nk[1])
    print(n, k)
    scores = input().split(" ")
    count = 0
    for i in range(n):
        scores[i] = int(scores[i])
    five = scores[k]
    for i in range(n):
        if scores[i] >= five and scores[i] > 0:
            count += 1
    print(count)


def Beautifulmatrix():
    steps = 0
    matrixes = []
    for i in range(5):
        i = [input().split(" ")]
        matrixes += i
    for i in range(5):
        for j in range(5):
            matrixes[i][j] = int(matrixes[i][j])
    for i in range(5):
        for j in range(5):
            if matrixes[i][j] > 0:
                x = j
                y = i
                break
    while x != 2 or y != 2:
        if x > 2:
            x -= 1
            steps += 1
        elif x < 2:
            x += 1
            steps += 1
        elif y > 2:
            y -= 1
            steps += 1
        elif y < 2:
            y += 1
            steps += 1
    print(steps)


def HelpfulMahts():
    s = input().split("+")
    s.sort()
    print("+".join(s))

def WordCapitalization():
    word = input()
    List = []
    for i in word:
        List.append(i)
    List[0] = List[0].upper()
    s = ""
    for i in List:
        s += i
    print(s)

def Stonesonthetable():
    n = int(input())
    stones = []
    rrg = input()
    counter = 0
    for i in rrg:
        stones.append(i)
    for i in range(n - 1):
        if stones[i] == stones[i + 1]:
            counter += 1
    print(counter)

def BearandBigBrother():
    inpuut = input().split(" ")
    a = int(inpuut[0])
    b = int(inpuut[1])
    year = 0
    while a <= b:
        a *= 3
        b *= 2
        year += 1
    print(year)

def Wrongsubtraction():
    nk = input().split(" ")
    n = int(nk[0])
    k = int(nk[1])
    for i in range(k):
        p = str(n)
        if p[len(p) - 1] == "0":
            n //= 10
        else:
            n -= 1
    print(n)

import string
def Word():
    word = input()
    lower = 0
    upper = 0
    for i in word:
        if i in string.ascii_lowercase:
            lower += 1
        else:
            upper += 1
    if upper > lower:
        word = word.upper()
    else:
        word = word.lower()
    print(word)

def QueueattheSchool():
    nt = input().split(" ")
    n = nt[0]
    t = int(nt[1])
    a = input()
    b = []
    ref = ""
    for i in a:
        b.append(i)
    for k in range(t):
        whre = []
        for i in range(len(b) - 1):
            if b[i] == "B" and b[i + 1] != "B":
                whre.insert( 0,i)
        for j in whre:
            b.pop(j)
            b.insert(j + 1, "B")
    for i in b:
        ref += i
    print(ref)

def Nearlyluckynumber():
    n = input()
    if n.count("7") + n.count("4") == 7 or n.count("7") + n.count("4") == 4:
        print("YES")
    else:
        print("NO")


def Translation():
    s = input()
    t = input()
    n = []
    for i in t:
        n.insert(0, i)
    t = ""
    for i in n:
        t += i
    if t == s:
        print("YES")
    else:
        print("NO")

Translation()