Depends on how you have it set up..
Easiest way would probably be if both top and bottomsprites were animation-frames so you'd only have to check if the animationframe is the same..
Otherwise working with variables (either text or number) would be a way, or even a numbered variable compared to an animation-frame..
Too much is unclear on how you are setting this up, or how it is set up to give any clearer answer..
That being said, once it is clear, it will be easy-peasy..