A compound having an ability to bind to an SlP receptor (particularly EDG-6,preferably EDG-1 and EDG-6), for example, the compound represented by formula(I) ofthe present invention, a salt thereof, a solvate thereof or a prodrug thereofis useful forprevention and/or treatment of rejection of transplantation, graft-versus-hostdisease,autoimmune disease, allergic disease and the like.(see formula I)wherein ring A is a cyclic group; ring B is a cyclic group which may havesubstituent(s); Xis a spacer having 1 to 8 atoms in its main chain, etc.; Y is a spacer having1 to 10 atoms inits main chain, etc.; n is 0 or 1, wherein when n is 0, m is 1 and R1 is ahydrogen atom or asubstituent, and wherein when n is 1, m is 0 or an integer of 1 to 7 and R1 isa substituent,and wherein in is 2 or more, R1s are the same or different.