#!/usr/bin/env python3 #fileencoding: utf-8 print("YES" if sorted(input()) == sorted(input()) else "NO")