Get logged-in state for Facebook

Is there a way to get the logged in state for a user.
So, if user 1 logs in or registers through facebook, show element X if they logged in or registered without facebook show Y?

Thanks!