Close, but Machine B needs to look at the source address and port number that it actually receives, which might be different than N.
The NAT at Machine A might not use the same port N that Machine A sent on. (Imagine machine C behind that same NAT also sending on port N: they can't both use it.) So Machine B might see a different source port, M. But if the NAT does that, then it should accept traffic sent back to port M and automatically map it back to N at Machine B.
In other words, as long as Machine B sends back to the source address and source port given in the packet it received, that you can reasonably expect the return packet to find its way back to the original source. This assumes that the return packet is sent within a short amount of time, as automatic NAT rules tend to timeout after some number of minutes.
You are correct that UDP does not "form connection" however the source and destination ports paired together does actually allow the NAT to uniquely identify which IP behind the NAT to send the packets to – portforwardpodcast – 2015-10-05T22:49:14.543