name = input().split(' ')

name_search = input()
print(name_search in name)