We propose a nonvolatile two-terminal memory device with two resistance states based on the molecular tunnel junctions. This tunnel junction is composed of one or a few monolayers of polar molecules sandwiched between two electrodes made of materials with different screening length. As a prototype model system we study a rare earth endohedral metallofullerene molecule with reversible dipole moment sandwiched between metal and semiconducting electrodes, forming a double barrier junction. We use the Thomas-Fermi model to calculate the potential profile across the device. Calculated tunneling conductance through the proposed structure changes by order of magnitude upon the reversal of the dipole orientation (due to the applied voltage). This effect originates from the difference in potential profiles seen by tunneling electrons for two opposite dipole orientations.