the is_an_bn program, written in java