We propose a nonvolatile two-terminal memory with two resistance states based on the molecular tunnel junctions. This tunnel junction is composed of one or few monolayers of polar molecules sandwiched between two electrodes made of materials with different screening length. As a prototype model system we study rare earth endohedral metallofullerene molecule with reversible dipole moment sandwiched by 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 of potential profile seen by tunneling electrons for two opposite dipole orientations.