The molar mass of an element mostly consists of the protons and neutrons (electrons are a few thousand times lighter). The atomic number of of Be is 4, meaning it has 4 protons (# of protons is what defines an element, change that, change the element). Since it has 4 protons and its weight is around 9, there are then typically 9-4= 5 neutrons. The fact that the weight is actually 4.012182 means that in a large sample there are a small percentage of other isotopes.