If I have a customer list like below in column A. Is there a formula that I can extract the first customer number when the grouping changes?

col A Col B
2323 2323
2323
2350 2350
2350
2350
2350
5000 5000
5000