Suppose $G, H$ are finite, simple, undirected graphs and there is a bijection between the vertex sets $\varphi:V(G) \to V(H)$ such that for all $v\in V$ we have $$\text{deg}_G(v) = \deg_H(\varphi(v)).$$
Does this imply that $G\cong H$? In case the answer is positive, does it remain so if we consider infinite graphs?