2-Friendly

Problem 643

Two positive integers and are 2-friendly when . For example, 24 and 40 are 2-friendly because while 24 and 36 are not because not a power of 2.
Let be the number of pairs, , of positive integers with such that and are 2-friendly. You are given and modulo .
Find modulo .