In Didiland, the land of fantasy, every resident carries one string as a token of fate. Whether two residents are a fantasy pair is decided in a very plain way. Join their two strings into one, and if that string can be cut exactly into two strings whose lengths are both prime, the two residents are a fantasy pair. Deciding whether such a cut exists is hard for them, so most of them walk past each other without ever knowing.
Write a program that decides whether two residents are a fantasy pair.
Assume that joining the strings and cutting them lose no length at all.