[NUCRDBMS-730] Restructure the check on whether an element in an M-N is
already present