tour-5
Source: hackerearth
Difficulty: HARD

Gautam Buddha University V.C. has planned a tour for GBU students. For the tour, V.C. decided to book cars. The students are ready to go on one condtition:
If two students are friends then they do not want to go in different cars.  

Due to this condition, V.C. cannot decide that how many cars will be needed for the tour. And for each car he also needs one leader in the car.  

As you are a programmer, so V.C. is giving you this task. Find the maximum number of cars he will need for the tour and the total number of ways of selecting leader in each car.

Input:
First line contains n, which denotes the number of students that will go for the tour.  
Second line contains m, which denotes the number of friendship relation between students.  
Next m lines will have two space separated integers a,b.  
Consider mutual friendship(a is a friend of b and vice versa).  

Output:
Output a single line containing two space separated integers - maximum number of cars he will be needed and the number of ways of selecting the leaders. Leaders will be modulo (10^6)+7.  

Note: Assume Capacity of a Car is unlimited.  

Constraints:
1 ≤ n ≤ 10^5
1 ≤ m ≤ 10^5
1 ≤ a,b ≤ 10^5

SAMPLE INPUT
6
3
1 2
3 4
5 6

SAMPLE OUTPUT
3 8

Explanation

In this sample we need three cars in which students are (1,2) ,(3,4),(5,6) and total number ways of selecting leaders in cars will be 8.