This graph has the same degree sequence as your $A$ and $B$, yet is not isomorphic to them:
o
/ \
o---o---o---o
This graph has the same degree sequence as your $A$ and $B$, yet is not isomorphic to them:
o
/ \
o---o---o---o