// C# implementation of the approach
using System;
public class GFG
{
// Function to return the factorial of a number
static int factorial(int f)
int fact = 1;
for (int i = 2; i <= f; i++)
fact *= (int)i;
return fact;
}
// Function to return the count of distinct
// (N + M) digit numbers having N 0's
// and and M 1's with no leading zeros
static int findPermutation(int N, int M)
int permutation = factorial(N + M - 1)
/ (factorial(N) * factorial(M - 1));
return permutation;
// Driver code
public static void Main()
int N = 2, M = 4;
Console.Write(findPermutation(N, M));