InP nanowire avalanche photodiode and bipolar junction phototransistor integrated on silicon substrate