This trial is conducted in Africa, Asia, Europe, Japan and North America. The aim of this trial is to evaluate the safety and efficacy, including pharmacokinetics (the rate at which the body eliminates the trial drug), of NNC-0156-0000-0009 (nonacog beta pegol) when used for treatment and prophylaxis of bleeding episodes in patients with haemophilia B.