The difference between atom A and atom B is that
The outer electron of atom B has moved to a higher energy state
Step-by-step explanation
The 1 outer electron of of atom B absorb energy and it jump to higher orbital that is from 3s orbital to 5s orbital .
At this state the electrons are said to be in excited state.
Electrons then emit energy which make them fall to lower state.